ekoz
June 21, 2016, 3:17pm
1
Hi, I’m trying to build my ionic2 app as an android apk.
cordova build --release android
(or) ionic build android
but the command stopped after build:before
gulp task.
I got this error, don’t know if it’s sptop the process or just a warning :
(node:18824) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
I tried other node version 6.x, same problem…
Cordova CLI: 5.1.1 Ionic Framework Version: 2.0.0-beta.9 Ionic CLI Version: 2.0.0-beta.31 Ionic App Lib Version: 2.0.0-beta.17 OS: Windows 7 SP1 Node Version: v6.2.0
This is a node 6x issue.
Node 6x introduced a lot of new changes and broke many npm modules, and some haven’t updated yet.
Best bet would be to downgrade to node 5x.
ekoz
June 21, 2016, 4:01pm
3
ok it works, but I still don’t have any android compilation… it comes from my conf?
matheo
June 21, 2016, 4:05pm
4
Any error message? the APK should be in platforms/android/build/outputs/apk/
ekoz
June 21, 2016, 4:23pm
5
No message at all :
prompt>ionic build android
Running 'build:before' gulp task before build
[18:22:17] Starting 'clean'...
[18:22:17] Finished 'clean' after 116 ms
[18:22:17] Starting 'build'...
[18:22:17] Starting 'sass'...
[18:22:17] Starting 'html'...
[18:22:17] Starting 'fonts'...
[18:22:17] Starting 'scripts'...
[18:22:17] Finished 'scripts' after 126 ms
[18:22:17] Finished 'fonts' after 179 ms
[18:22:17] Finished 'html' after 212 ms
[18:22:18] Finished 'sass' after 1.28 s
[18:22:37] Finished 'build' after 20 s
[18:22:37] Starting 'build:before'...
[18:22:37] Finished 'build:before' after 8.62 µs
prompt>
matheo
June 21, 2016, 4:37pm
6
Maybe a Node 6.x problem, downgrade it as Mike suggested
ekoz
June 22, 2016, 7:47am
7
@matheo i did it, with node v5.11 the error doesn’t occurs, but I still don’t have any android compilation, and no android/build
folder…
I’ve created a new project, to test with a basic configuration, and the build command do not generate any apk, log, error…
prompt>ionic start myapp --v2 --ts
...
prompt>cd myapp
prompt>ionic platform add android
...
prompt>ionic build android
Running 'build:before' gulp task before build
[09:39:23] Starting 'clean'...
[09:39:23] Finished 'clean' after 19 ms
[09:39:23] Starting 'build'...
[09:39:23] Starting 'sass'...
[09:39:23] Starting 'html'...
[09:39:23] Starting 'fonts'...
[09:39:23] Starting 'scripts'...
[09:39:23] Finished 'html' after 134 ms
[09:39:23] Finished 'scripts' after 137 ms
[09:39:23] Finished 'fonts' after 183 ms
[09:39:25] Finished 'sass' after 2.28 s
[09:39:39] Finished 'build' after 16 s
[09:39:39] Starting 'build:before'...
[09:39:39] Finished 'build:before' after 46 µs
prompt>
matheo
June 22, 2016, 1:44pm
8
You have a big issue if you don’t have the platforms/android
folder and ionic is not trying to download it before build. Run:
ionic platform add android
then try again. Be sure you have your android sdk correctly installed, as ANDROID_HOME
and JAVA_HOME
environment variables are required.
ekoz
June 22, 2016, 3:04pm
9
the android platform exist, and android_home, java_home, path are setted…
myapp>ls platforms\android
AndroidManifest.xml CordovaLib assets build.gradle cordova libs platform_www project.properties res settings.gradle src
myapp>echo %JAVA_HOME%
C:\Program Files\Java\jdk1.8.0_45
myapp>echo %ANDROID_HOME%
C:\Programmes\Android\sdk
myapp>echo %PATH%
C:\Programmes\Android\sdk\platform-tools;C:\Programmes\Android\sdk\tools;[...]
I don’t unerstand why there are no error message, it’s like the command doesn’t call at all any build process and end normally
ekoz
June 23, 2016, 9:26am
10
@matheo @mhartington do not work with node v5.11.1 but works with v5.6.0.
Sorry for all this posts and thanks for your help!
1 Like