6

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

vbotio
  • 1,566
  • 3
  • 26
  • 53
  • Possible duplicate of [how to create signed APK file using cordova command line interface](http://stackoverflow.com/questions/26449512/how-to-create-signed-apk-file-using-cordova-command-line-interface) – Midhun KM Aug 01 '16 at 04:15

3 Answers3

4

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.

Jon
  • 6,437
  • 8
  • 43
  • 63
3

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
Midhun KM
  • 1,647
  • 1
  • 21
  • 31
0

Sorry I couldn't comment. Possible duplicate?

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

This worked perfect for me.

Community
  • 1
  • 1
Actiwitty
  • 1,232
  • 2
  • 12
  • 20