Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cordova build -release Android Unsigned apk

I'm trying to generate my release apk to deploy it on Play Store. I'm running this command

Sudo cordova build android --release

Which is generating me a file named Android-Release-Unsigned.apk

I tried many solutions, like creating keystore

keytool -genkey -v -keystore key-name.keystore -alias alias-name -keyalg RSA -keysize 2048 -validity 10000

or the trick of creating a Ant.properties file like here and none of them worked at all.

Any other possible solution for this ? Cordova version is 5.1.1

like image 583
vbotio Avatar asked Jul 21 '15 19:07

vbotio


2 Answers

Create a file called release-signing.properties and put in APPFOLDER\platforms\android folder Cordova used to use ant.properties but now ignores that file.

Contents of the file: edit after = for all except 2nd line

storeFile=C:/yourlocation/app.keystore
storeType=jks
keyAlias=aliasname
keyPassword=aliaspass
storePassword=password

Now running cordova build android --release should produce a signed version.

like image 188
Jon Avatar answered Oct 21 '22 03:10

Jon


If you have keystore file generated, this should work.

You may also need to remove console plugin if the same apk directly goes to production.

In cordova 6.2.0

cd cordova/ #change to root cordova folder
platforms/android/cordova/clean #clean if you want
cordova build android --release -- --keystore="/path/to/keystore" --storePassword=password --alias=alias_name #password will be prompted if you have any
like image 45
Midhun KM Avatar answered Oct 21 '22 03:10

Midhun KM