Reputation: 267
I'm trying to build my Ionic 2 app to get a .apk but I don't know if I can get it the same way as Ionic 1 (my app runs with Chrome Developper Tools actually).
In the documentation : http://ionicframework.com/docs/v2/getting-started/installation/ it says to do ionic run android
to build.I only have the emulator correctly displayed but my app is not running in it and I don't see any .apk in my app folder.
I tried the Ionic 1 way, cordova build --release android
as it is sayed here http://ionicframework.com/docs/guide/publishing.html but after few minutes of many .jar downloads I got this error:
FAILED
Exception in thread "main"
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':transformClassesWithDexForRelease'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_79\bin\java.exe''
finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
BUILD FAILED
Total time: 23.223 secs
Error: Error code 1 for command: cmd with args: /s,/c,"C:\PATH\app\platforms\android\gradlew
cdvBuildRelease -b C:\PATH\app\platforms\android\build.gradle
-Dorg.gradle.daemon=true
-Pandroid.useDeprecatedNdk=true"
Can someone help me manage it ?
Thanks by advance !
Upvotes: 2
Views: 6547
Reputation: 51
try to run the following command
ionic build android --release
and you get the apk in MyApp\platforms\android\build\outputs\apk
Upvotes: 3
Reputation: 44659
If no error is shown after runnning ionic run android
, you should find the .apk
in this folder:
MyApp\platforms\android\build\outputs\apk
Upvotes: 0