Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cordova 6.4.0 Android error when building release apk

I had a project working well on cordova 6.3.1 .

Then I updated cordova and my project to 6.4.0 . After this, first time I built, gradle got automatically updated too.

Now I am experiencing an important issue:

I need to include the keystore and alias passwords in the build.json file or the release apk generation fails with error.

I use a build.json file like this:

{
"android": {
    "debug": {
        "keystore": "C:\\Path\\To\\Keystores\\debug.keystore",
        "storePassword": "debugpass",
        "alias": "thedebugalias",
        "password" : "debugpass",
        "keystoreType": ""
    },
    "release": {
        "keystore": "C:\\Path\\To\\Keystores\\theapp.keystore",
        "storePassword": "",
        "alias": "thealias",
        "password" : "",
        "keystoreType": ""
    }
}    

}

And then run this command to generate the release apk:

cordova build android --release --buildConfig=build.json

Until now, this worked well and it prompted me to enter both keystore and alias passwords. And then built the apk ok.

After upgrading to Cordova 6.4.0, it doesn't work anymore. It never prompts for the passwords, and then the building process fails because "the keystore has been tampered with or the password is incorrect".

If I include the passwords in the build.json file, the release apk gets generated ok, since it already has the passwords there and doesn't need to prompt for them.

I don't like having the keystore passwords in plain text in the build.json file. Has anyone experienced this same issue? Any ideas on how to fix this?

Thanks.

EDIT: I noticed another problem. It is not showing my icons and splash screens. EDIT: This last problem, about not showing icons and splash screens, is a bug in the new Cordova version and it is being resolved https://issues.apache.org/jira/browse/CB-12077

like image 204
Vero Avatar asked Oct 31 '16 20:10

Vero


1 Answers

This issue has been solved: https://issues.apache.org/jira/browse/CB-12159

As of now you can use cordova platform add [email protected] or cordova platform add https://github.com/apache/cordova-android

Keep in mind that the second command adds the latest version and it may introduce other bugs....

In the future you may use cordova platform add [email protected] but as of now 6.2.0 does not exist. (Check here: https://github.com/apache/cordova-android/releases)

like image 165
Rodrigo Graça Avatar answered Sep 26 '22 19:09

Rodrigo Graça