【问题标题】:android version Code android version name cordovaandroid 版本代码 android 版本名称 cordova
【发布时间】:2017-10-18 23:00:59
【问题描述】:

更改我的代码后,我尝试使用cordova 更新我的android 应用程序版本。 在 AndroidManifest.xml 中,我将 android:versionName 更改为更高的数字,例如“1.2.9”到“1.2.10”,并且 android:versionCode 在同一个文件中。 使用 cordova 构建后,这两个数字会自动更改。我试图在 config.xml 文件中添加 android:versionName 但是在cordova构建之后发生了同样的事情并且在构建过程中我得到了错误

FAILURE: Build failed with an exception.
  • 出了什么问题: 任务“:processReleaseResources”执行失败。

    com.android.ide.common.process.ProcessException: 无法执行 aapt

知道如何解决这个问题吗?

【问题讨论】:

    标签: android cordova extjs sencha-cmd


    【解决方案1】:

    要设置 android 的版本代码和版本名称,您必须将 android-versionCode=""version="" 添加到 config.xml 中的 <widget> 标记中,如下例所示:

    <widget android-versionCode="100" version="1.0.0" ... >
    

    您不应直接修改 platforms 文件夹中的任何内容,因为它会在您准备/构建/读取平台时重新创建。

    【讨论】:

    • 通过添加 android-versionCode="100" version="1.0.0" 现在 android:versionName="1.2.10" 没问题,但 android:versionCode="" 再次自动更改为数字比以前的版本小,这是在 google play 中上传应用程序的问题。我在文件夹 /cordova/config.xml /cordova.js/config.xml 和 /cordova/platforms/android/res/xml/config.xml 中添加了您编写的上述代码,其中哪个文件夹是正确的?跨度>
    • 通过在 config.xml 的小部件中添加 xmlns:android = "schemas.android.com/apk/res/android" 解决了错误但是 android:versionCode 的问题仍然存在,关于那个?
    • 不要修改platforms/android文件夹中的anything,它是在您运行构建时生成的,并且总是会被重置。你必须修改&lt;your-project-root/src/config.xml中的config.xml
    猜你喜欢
    • 1970-01-01
    • 2013-02-11
    • 2021-10-22
    • 1970-01-01
    • 1970-01-01
    • 2016-11-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多