I am trying to run ionic build --release android on a windows system. After build starts it stops with this:
[13:42:16] Finished ‘build:before’ after 8.31 μs
✗ You cannot run iOS unless you are on Mac OSX.
My cordova version is 6.3.0. I tried ionic state reset and npm install -g cordova. Running ionic build android works fine. Hope you can help fix this strange issue
I think u need a mac to compile the ios build, there was another way to compile without being on mac, im in my phone so cant find it, ill try to post the link to it.
I am trying to compile a android build and that worked fine before. Still thanks for your time @victorcarvalhsop: thanks it worked. Seems they changed the cli a bit.
thank you!
i managed to output android-release-unsigned.apk
i submit to https://play.google.com/apps/publish/
but there is a new error message
Upload failed
You uploaded an APK that is not zip aligned. You will need to run a zip align tool on your APK and upload it again.
Yes you have to zipalign the unsigned.apk to sign it first. I have a step by step guide for my environment on windows. The paths may be differ from yours.
Step 0 (only the first time):
run ionic platform add android (cli)
Step 1.1 (only when publishing the second and above time)
Step 1.6:
run “C:\program files (x86)\Android\android-sdk\build-tools\23.0.3\zipalign” -v 4 android-release-unsigned.apk yourAppName.apk
Your jarsigner and zipalign tool may be in different paths than my so just find them and pass the correct path. In my case I also had to set my android environment in the cli and the correct path for the platform tools. If thats the case:
Step 2:
Run
set ANDROID_HOME=C:\program files (x86)\android\android-sdk
set PATH=%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools
En versiones anteriores de ionic se utitlizaba ionic build --release android para poder generar el archivo release, en versiones actualues de ionic utiliza ionic build android --release