Cordova signing android application : not working with build.json

5.4k Views Asked by At

I work on cordova 5.x and i would generate a signing apk.

I start to use build.json at the root of the cordova project with certificat credentials :

{
  "android": {
   "debug": {
      "keystore": "cert.keystore",
      "storePassword": "*****",
      "alias": "1",
      "password" : "*****",
      "keystoreType": "PKCS12"
    },

It create a release-signing.properties in platforms/android like that :

key.store=..\\..\\cert.keystore
key.alias=1
key.store.password=*****
key.alias.password=*****
key.store.type=PKCS12

But i have an error : cert.keystore": DerInputStream.getLength(): lengthTag=109, too big (because it don't understand the key is a PKCS12 type)

After i write my own release-signing.properties like that :

storeFile=..\\..\\cert.keystore
storePassword=*****
keystoreType=PKCS12
keyAlias=1
keyPassword=*****

And it works ... so i don't understand why the first solution doesn't work.

1

There are 1 best solutions below

0
On

On Cordova 5, there is no need to manually edit this "release-signing.properties" file.

You just need to save the "build.json" and the "cert.keystore" files at the root of your project (exactly like you already do). After that, run the command on cordova CLI:

cordova build android --release.

Furthermore, you should never touch any file inside the platform folder. In my case, I don't even trace them on my git repo.