I just executed the command "ionic build android" on my ionic 2 project and it was done successfully it says. But there is no APK file generated. What am I supposed to do? Thanks in advance. I'm using node v6.11.2, Ionic CLI 3.7.0, cordova 7.0.1.
-
1The apk is normally generated in `yourProject/platforms/android/build/outputs/apk/android-release-unsigned.apk`. If it isn't there, please add in your output of the command – Ivar Reukers Aug 19 '17 at 13:41
-
yes, but there is no /build folder inside my android folder. – noob Aug 19 '17 at 13:46
-
Having the same issue – OshoParth Aug 23 '17 at 18:40
-
you can follow following link https://stackoverflow.com/questions/34116446/generate-non-debug-apk-from-ionic/45866053#45866053 – Yusuf Aug 24 '17 at 15:52
-
Thank you, I already solved the issue, I manually installed the gradle and set all the Environmental Variables properly. – noob Aug 26 '17 at 02:58
3 Answers
First create an account at ionic Io than hit this ionic Io init in project directory after login hit this ionic package build android after successful your apk file store in your cloud and download it and install

- 11
- 3
-
Include some images so it can help people understand the answer better. – UmarZaii Aug 19 '17 at 14:04
-
Thanks for the answer. I'm sorry but what exactly I gonna do to get the APK file. – noob Aug 19 '17 at 14:11
-
set all software(node.js,apache ANT,Java JDK & JRE,Android SDk & Eclipse) path into environmental- variable and run npm install -g cordova than generate apk file run ionic cordova build android – akshay ambaliya Aug 19 '17 at 14:26
-
I try run to run the command ionic cordova build android and I getting this [ERROR] An error occurred while running cordova build android (exit code 1): ANDROID_HOME=C:\Users\Administrator\AppData\Local\Android\android-sdk JAVA_HOME=C:\Program Files\Java\jdk1.8.0_144 Error: Could not find an installed version of Gradle either in Android Studio, or on your system to install the gradle wrapper. Please include gradle in your path, or install Android Studio – noob Aug 19 '17 at 14:44
-
i think some problen in your android studio Gradle try this to solved 1)download gradle latest version bin file this link (https://gradle.org/releases/) 2)extract the winzip file into java folder (e.gC:\ProgramFiles\Java\jdk1.8.0_101\gradle-3.5) 3)go to my computer right click -> properties. 4)then go to advanced system setting in left side menu. 5)advances -> environment Variables then select Path. 6)add new environment variable called %GRADLE_HOME%/bin – akshay ambaliya Aug 19 '17 at 15:48
-
thank you for all the responds, I already solved the issue by manually installing the gradle and setting all the Environmental Variables properly. – noob Aug 26 '17 at 02:55
The Path as mentioned before is the correct path to find your generated apk file.
yourProject/platforms/android/build/outputs/apk/android-release-unsigned.apk
Please check these steps if there something missing.
I. Development environment dependencies
1)You need at Least to download a java JDK 8
2)Download an Android SDK manager
3)you must Add them to the environment variables
(Windows)
i)Open environment variables
ii)ANDROID_HOME:create a new user variable with name ANDROID_HOME and add the path of the SDK manager ex.C:\xxx\Android\sdk
iii)edit the user variable PATH value and add to it platform tools path ex. C:\xxx\Android\sdk\platform-tools
iV)JAVA_HOME:Don't forget also to edit in the user variable PATH, your old JAVA_HOME env path with the new JDK Path . ex.C:\Program Files\Java\jdk1.8.0_144
4)Globally install ionic and cordova
npm install -g ionic cordova
II. Ionic CLI for build android
5)ionic cordova platform add android
6)ionic cordova build android
N.B: there sometimes logging in issue through CLI when using this command, the next steps doesn't really make sense but it worked for me.
ionic config set backend pro -g
Retry the build process again ,if Still there a problem change to legacy and Then again back to pro
ionic config set backend legacy -g
ionic config set backend pro -g
It should work now, retry the build process again.
If still there a problem then make an app through the website of ionic use this command with the --pro-id of your app and retry again.
ionic start --pro-id <ID>

- 913
- 7
- 10
Follow this steps
- Run
ionic cordova build --release android
- Open android studio go to Build -> Generate Signed APK, press next
- If you don't have Key store please create new one
- Finish
you can find the APK under Platforms/android

- 2,228
- 3
- 19
- 46

- 577
- 1
- 5
- 14
-
1thank you for the answer, what to do if I do not have Android Studio installed. – noob Aug 19 '17 at 14:48
-
[ERROR] An error occurred while running cordova build android (exit code 1): ANDROID_HOME=C:\Users\Administrator\AppData\Local\Android\android-sdk JAVA_HOME=C:\Program Files\Java\jdk1.8.0_144 Error: Could not find an installed version of Gradle either in Android Studio, or on your system to install the gradle wrapper. Please include gradle in your path, or install Android Studio I am getting that error message when I run the ionic cordova build android command. – noob Aug 19 '17 at 14:50
-
for this approch you should have android studio, there is any season way you don't want to install android studio?, also see http://ionicframework.com/docs/v1/guide/publishing.html – mohamad rabee Aug 19 '17 at 14:52
-
My device cant handle Android Studio that is why I choose Ionic Framework. Is there any other way I can solve this problem? – noob Aug 19 '17 at 14:57
-
this may help you http://ionicframework.com/docs/v1/guide/publishing.html – mohamad rabee Aug 19 '17 at 14:59
-
I already solved the issue, I manually installed the gradle and set all the Environmental Variables properly. – noob Aug 26 '17 at 02:57