其他分享
首页 > 其他分享> > Expo React-Native Android版本不会更新Google Play版本代码

Expo React-Native Android版本不会更新Google Play版本代码

作者:互联网

我构建了一个React-Native安卓应用程序并上传到Google Play,运行正常.

现在我有一个我想上传的新版本(没有问题上传到itunes Connect),Google Play给了我这个错误:
“您需要为APK或Android App Bundle使用不同的版本代码,因为您已经拥有版本代码为1的版本代码.”

每次构建之后,我都在app.json中更新了版本,我也尝试更新package.json中的版本.我已经完成了对’versionCode’的目录范围搜索,并且没有实例.目录范围内的’版本’搜索结果超过2,000个,我滚动浏览了所有这些结果,并没有看到任何特定的android构建.我没有iOS构建的问题.

我尝试使用Max Expo XDE首先发布应用程序,然后使用“exp build:android”在命令行中构建它.

我的app.json中有以下内容:

{
  "expo": {
    "name": "Placeholder",
        "sdkVersion": "27.0.0",
        "privacy": "unlisted",
        "orientation": "portrait",
        "icon": "./assets/img/AppIcon.png",
    "version": "0.3.4",
    "ios": {
      "bundleIdentifier": "com.placeholder.placeholder"
    },
    "android": {
      "package": "com.placeholder.placeholder"
    }
  }
}

我的package.json如下(并且已运行npm install):

{
  "name": "placeholder",
  "version": "0.2.0",
  "private": true,
  "devDependencies": {
    "jest-expo": "~27.0.0",
    "react-native-scripts": "1.14.0",
    "react-test-renderer": "16.3.1"
  },
  "main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
  "scripts": {
    "start": "react-native-scripts start",
    "eject": "react-native-scripts eject",
    "android": "react-native-scripts android",
    "ios": "react-native-scripts ios",
    "test": "jest"
  },
  "jest": {
    "preset": "jest-expo"
  },
  "dependencies": {
    "axios": "^0.18.0",
    "expo": "^27.0.1",
    "native-base": "^2.4.3",
    "react": "16.3.1",
    "react-native": "https://github.com/expo/react-native/archive/sdk-27.0.0.tar.gz",
    "react-native-svg": "^6.3.1",
    "react-navigation": "^2.0.0",
    "redux-thunk": "^2.2.0",
    "socket.io-client": "^2.1.0"
  }
}

解决方法:

我也遇到过这个问题,我通过在android下的app.json中添加versionCode解决了这个问题.例如,

“android”:{
      “versionCode”:2
}

请注意,’2’没有引号.

标签:expo,android,react-native
来源: https://codeday.me/bug/20190910/1798373.html