gpt4 book ai didi

android - 从 Azure DevOps 部署到 Google Play 商店时出现错误 "APK specifies a version code that has already been used.."

转载 作者:行者123 更新时间:2023-12-02 23:23:11 25 4
gpt4 key购买 nike

我正在尝试使用 Azure DevOps 中的 YML 管道将 Nativescript 应用部署到 Google Play 商店。有一个部署任务会自动增加versionCode和versionNumber,以前一直工作得很好。

但是现在我们上传,我收到此错误:

##[error]Error: Failed to upload the bundle /Users/runner/work/1/_Android/app-release.aab. Failed with message:Error: APK specifies a version code that has already been used..

我看到 Google Play 商店中的最新版本是 1.0.3601

VersionCode in Google Play store

在发布管道中,我看到生成的 versionCode 是 1.0.3603,versionName 是 1.0.3604

VersionCode in Azure DevOps release pipeline

如何解决这个问题?我做错了什么?

最佳答案

根据User Kingston Fortune - Stack Overflow的建议,请确保更改 build.gradle 文件中的 versionCode 和 versionName:

defaultConfig {
applicationId "com.my.packageId"
minSdkVersion 16
targetSdkVersion 27
versionCode 2 <-- increment this by 1
versionName "2.0" <-- this is the version that shows up in playstore,
remember that the versioning scheme goes as follows.
first digit = major breaking changes version
second digit = minor changes version
third digit = minor patches and bug fixes.
e.g versionName "2.0.1"
}

引用文献:Upload failed You need to use a different version code for your APK because you already have one with version code 2 , Problem with build version when publishing APK to Play Store , https://github.com/bitrise-steplib/steps-google-play-deploy/issues/31https://developer.android.com/studio/publish/versioning#appversioning

关于android - 从 Azure DevOps 部署到 Google Play 商店时出现错误 "APK specifies a version code that has already been used..",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71455094/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com