React Native Expo 版本代码 1 已被使用。尝试另一个版本代码

Bil*_*oob 11 android react-native expo

更新我的应用程序后,我尝试将我的博览会应用程序上传到 Playstore,但一次又一次出错。我更改了 app.json version": "2.0.0"中的版本,并尝试了此version": "1.0.1"version": "1.0.2"。我不知道为什么它向我显示此错误。

回答 ios.buildNumber 和 android.versionCode 区分应用程序的不同二进制文件。确保为您上传到 App Store 或 Google Play Store 的每个版本增加这些值。

Phạ*_*Tài 23

您需要增加 android versionCode 和 iOS buildNumber,而不是版本字符串。

"ios": {
  "bundleIdentifier": "com.yourcompany.yourappname",
  "buildNumber": "1.0.0" //increase it for iOS
},
"android": {
  "package": "com.yourcompany.yourappname",
  "versionCode": 1 //increase it for android
}
Run Code Online (Sandbox Code Playgroud)


Giv*_*nga 13

有一种自动化的方法可以做到这一点,expo 会为您做这件事。当您忘记更新这些版本时,它可以防止再次浪费时间和资源进行重建。

eas.json"autoIncrement": true了!

{
  "cli": {
    "appVersionSource": "remote"
  },
  "build": {
    "staging": {
      "distribution": "internal",
      "android": {
        "buildType": "apk"
      }
    },
    "production": {
      "autoIncrement": true
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

这里有更多关于文档的信息,其中有另一个选项localremotehttps: //docs.expo.dev/build-reference/app-versions/