错误“APK 指定的版本代码已被使用。”从 Azure DevOps 部署到 Google Play 商店时

发布于 2025-01-13 19:21:22 字数 708 浏览 0 评论 0原文

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

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

##[错误]错误:无法上传包/Users/runner/work/1/_Android/app-release.aab。失败并显示消息: 错误:APK 指定的版本代码已被使用。

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

Google Play 商店中的VersionCode

在发布管道中,我看到生成的 versionCode是 1.0.3603,版本名称是 1.0.3604

Azure DevOps 发布管道中的版本代码

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

I'm trying to deploy our Nativescript app to the Google Play Store using a YML pipeline in Azure DevOps. There is a deployment task that automatically increases the versionCode and versionNumber, which always used to work fine.

However now that we upload, I get this error:

##[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..

I see that the latest version in Google Play store is 1.0.3601

VersionCode in Google Play store

In the release pipeline I see that the versionCode generated is 1.0.3603 and versionName is 1.0.3604

VersionCode in Azure DevOps release pipeline

How can this be solved? What am I doing wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

可爱咩 2025-01-20 19:21:22

根据用户 Kingston Fortune - Stack Overflow 的建议,请务必更改 versionCode 和 versionName在 build.gradle 文件中:

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"
}

参考文献:上传失败您需要为 APK 使用不同的版本代码,因为您已有版本代码为 2 的 APK将 APK 发布到 Play 商店时构建版本出现问题 , https://github.com/bitrise-steplib/steps-google-play-deploy/issues/31https://developer.android.com/studio/publish/versioning#appversioning

As suggested by User Kingston Fortune - Stack Overflow, make sure to change versionCode and versionName in build.gradle file:

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"
}

References: 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/31 and https://developer.android.com/studio/publish/versioning#appversioning

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文