Cordova 6.4.0 Android错误当构建发布apk [英] Cordova 6.4.0 Android error when building release apk

查看:1172
本文介绍了Cordova 6.4.0 Android错误当构建发布apk的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目在cordova 6.3.1上工作良好。

I had a project working well on cordova 6.3.1 .

然后我将cordova和我的项目更新为6.4.0。

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:

我需要包括keystore和别名密码在build.json文件或发布apk生成失败,错误。

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

我使用这样的build.json文件:

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": ""
    }
}    

}

运行此命令生成版本apk:

And then run this command to generate the release apk:

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

到现在为止,它运行良好,它促使我输入密钥库和别名密码。然后构建apk确定。

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

升级到Cordova 6.4.0后,它不再工作了。它从不提示输入密码,然后构建过程失败,因为密钥库已被篡改或密码不正确。

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".

如果我在build.json文件中包含密码,则发布版本apk会生成ok,因为它已经有密码,不需要提示。

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.

我不喜欢在build.json文件中使用纯文本的密钥库密码。有没有人遇到过同样的问题?关于如何解决这个问题的任何想法?

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?

谢谢。

编辑:我注意到另一个问题。它不显示我的图标和闪屏。
编辑:最后一个问题,不显示图标和启动屏幕,是新的Cordova版本中的一个错误,它正在解决 https://issues.apache.org/jira/browse/CB-12077

I noticed another problem. It is not showing my icons and splash screens. 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

推荐答案

此问题已解决: https://issues.apache .org / jira / browse / CB-12159

现在可以使用 cordova platform add android@6.2.0- nightly.2016.12.9.6c60dc5d
cordova平台添加https://github.com/apache/cordova-android

请记住,第二个命令添加最新版本,它可能会引入其他错误....

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

未来您可以使用 cordova平台添加android@6.2.0 ,但现在 6.2.0 不存在。 (查看此处: https://github.com/apache/cordova-android/releases

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

这篇关于Cordova 6.4.0 Android错误当构建发布apk的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆