vbotio
vbotio

Reputation: 1674

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

Upvotes: 6

Views: 21036

Answers (3)

Jon
Jon

Reputation: 6541

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.

Upvotes: 4

Midhun KM
Midhun KM

Reputation: 1717

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

Upvotes: 3

Actiwitty
Actiwitty

Reputation: 1242

Sorry I couldn't comment. Possible duplicate?

How to create a signed APK file using Cordova command line interface?

This worked perfect for me.

Upvotes: 0

Related Questions