Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does "ionic cordova build" only generate unsigned APKs?

I use the below command in order to generate a signed APK, I'm pretty sure this worked a few months ago:

$ ionic cordova build android --prod --release --keystore="./my-keystore-file.keystore" --storePassword=mypass [email protected] --password=mypass

However, only an unsigned APK is generated. How can I generate a signed APK using ionic?

like image 885
Jas Avatar asked May 19 '17 09:05

Jas


People also ask

What does ionic Cordova build do?

Running with Cordova​ The Ionic CLI can build, copy, and deploy Ionic apps to Android simulators and devices with a single command. It can also spin up a development server, like the one used in ionic serve , to provide live-reload functionality.

How do I create an AAB file in ionic?

Generating an AAB in Android Studio To create an AAB binary locally using Android Studio, open the Build menu, then choose “Generate Signed Bundle / APK.” Follow the prompts to sign the AAB with your keystore file. For complete details, view the Android documentation.


1 Answers

You need to include -- -- before the Cordova-specific arguments:

$ ionic cordova build android --prod --release -- -- --keystore="./my-keystore-file.keystore" --storePassword=mypass [email protected] --password=mypass

The build android --prod --release options are handled by the Ionic CLI, whereas everything after the first -- is passed to the Ionic Cordova plugin. Then everything after the 2nd -- is passed to Cordova itself.

like image 169
Dave Bauman Avatar answered Oct 13 '22 01:10

Dave Bauman