简体   繁体   English

导出android apk时出现版本代码错误

[英]Version code error in exporting android apk

I have an app in the playstore. 我在Playstore有一个应用程序。 Its version code is 18. Now made an update in the app and changed the version code to 19. Cant upload the apk it shows the error. 它的版本代码是18.现在在应用程序中进行了更新,并将版本代码更改为19.无法上传apk,显示错误。

This configuration cannot be published for the following reason(s): Version 18 is not served to any device configuration: all devices that might receive version 18 would receive version 28. 由于以下原因,无法发布此配置:版本18不会提供给任何设备配置:可能接收版本18的所有设备都将收到版本28。

Some devices are eligible to run multiple APKs. 某些设备有资格运行多个APK。 In such a scenario, the device will receive the APK with the higher version code. 在这种情况下,设备将接收具有更高版本代码的APK。

When i checked the AndroidManifest.xml file it shows error in the versioncode section 当我检查AndroidManifest.xml文件时,它在版本代码部分显示错误

This versionCode value (18) is not used; 不使用此versionCode值(18); it is always overridden by the value specified in the Gradle build script (28) less... (Ctrl+F1) 它始终被Gradle构建脚本(28)中指定的值覆盖...(Ctrl + F1)

The value of (for example) minSdkVersion is only used if it is not specified in the build.gradle build scripts. (例如)minSdkVersion的值仅在build.gradle构建脚本中未指定时使用。 When specified in the Gradle build scripts, the manifest value is ignored and can be misleading, so should be removed to avoid ambiguity. 在Gradle构建脚本中指定时,清单值将被忽略并且可能会产生误导,因此应将其删除以避免歧义。

Actually im a noobie in android development. 其实我是android开发中的noobie。 Can you guys help me ? 你们能帮助我吗?

Go to the Build.Gradle for your module. 转到模块的Build.Gradle。

Find a line that says something similar to: 找到一条类似于以下内容的行:

versionCode xx

"xx" will be an integer. “xx”将是一个整数。

Delete it. 删除它。 Rebuild your project. 重建您的项目。

Or delete it from your manifest and only manage it in your Build.Gradle file. 或者从清单中删除它,并仅在Build.Gradle文件中对其进行管理。

If a field is defined both in your Build.Gradle and your manifest file, the Build.Gradle overrides the manifest file. 如果在Build.Gradle和清单文件中都定义了一个字段,Build.Gradle将覆盖清单文件。

If you're unfamiliar with Gradle, you should get familiar with it. 如果你不熟悉Gradle,你应该熟悉它。 It's extremely powerful and can cause headaches if you don't understand how it works. 它非常强大,如果您不理解它是如何工作的,可能会引起头痛。 Learn more here. 在这里了解更多。

从您的Android清单中删除版本代码,只将其保存在gradle文件中。

请确保您有在的build.gradle(用于应用程序) 同步 - ED

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM