【发布时间】:2020-12-19 20:02:27
【问题描述】:
我正在尝试上传捆绑包 (.aab) 以发布应用程序的新更新。 我能够正确捆绑和签名,但是当我尝试上传 .aab 时出现此错误
Your app currently targets API level 27 and must target at least API level 29 to ensure it is built on the latest APIs optimized for security and performance. Change your app's target API level to at least 29. Learn More
You need to use a different version code for your APK or Android App Bundle because you already have one with version code 1.
我的 gradle.build 的目标是 API 29,版本代码是 9。我不确定这里发生了什么。
android {
compileSdkVersion 29
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId "com.organization.myApplication
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion 29
versionCode 9
versionName "9"
}
...
}
我遇到的一个解决方案是将 app/build.gradle 更新为目标 SDK 29,然后将项目与 gradle 文件同步。但是,它告诉我这不是一个基于 gradle 的项目。据我了解是这样。我用 gradle 导入了项目,有一个 gradle 包装器,并且我在 android 文件夹的顶部都有 build.gradle 和 settings.gradle。顶层的 build.gradle 是一个配置 buildscript,其中针对 SDK 29 的 build.gradle 位于 android/app 文件夹中。
【问题讨论】:
标签: android react-native google-play-console