在Playstore开发者控制台

时间:2016-12-31 13:41:13

标签: android cordova android-manifest build.gradle

实际上我正在使用cordova应用程序,为了进行许可证验证,我在android studio中打开了cordova应用程序,https://github.com/javiersantos/PiracyChecker/ build.gradle(模块:android)文件

dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
// SUB-PROJECT DEPENDENCIES START
debugCompile(project(path: "CordovaLib", configuration: "debug"))
releaseCompile(project(path: "CordovaLib", configuration: "release"))

compile project(':library')

// SUB-PROJECT DEPENDENCIES END
}

Androidmanifest.xml 文件

<manifest android:hardwareAccelerated="true"
android:versionCode="3"
android:versionName="0.0.3"
package="com.html.codeplay.pro" xmlns:android="http://schemas.android.com/apk/res/android">

以下步骤
1)我已经有很多应用程序,所以我知道在 androidmanifest.xml config.xml文件中增加版本代码和版本名称的方法。我已经在Androidmanifest.xml上面写了。在这里,我无法找到 config.xml 文件(我认为这仅适用于cordova应用程序),因为现在我将整个cordova android文件夹加载到android studio。

2)我试图直接在build.gradle文件上编写版本代码和版本名称,如下所示

defaultConfig {
    //versionCode cdvVersionCode ?: new BigInteger("" + privateHelpers.extractIntFromManifest("versionCode"))
    applicationId privateHelpers.extractStringFromManifest("package")

    if (cdvMinSdkVersion != null) {
        minSdkVersion cdvMinSdkVersion
    }

versionCode 3
versionName "0.0.3"
}

最终结果
当我在Playstore中上传此文件时,它始终显示为您的APK的版本代码需要高于28。您能以其他方式向我推荐。

1 个答案:

答案 0 :(得分:3)

如你所说:

  

当我在Playstore上传此文件时,它始终显示您的APK版本代码需要高于28。

您已使用versionCode 28上传了一个APK,您需要将版本代码增加到28以上才能在Google Play商店上传更新。

如果你有多个模块,你需要确保在主模块中设置正确的版本而不是一个小的依赖。

我建议您将版本信息保存在一个位置 - AndroidManifest.xmlbuild.gradle。虽然build.gradle具有更高的优先级,但Gradle在构建应用程序时将忽略AndroidManifest.xml中的值。