27.0.0不是有效的SDK版本。选项为31.0.0、32.0.0、33.0.0未版本化

时间:2019-06-02 10:13:33

标签: react-native react-native-android expo

我无法使用Expo Android应用程序运行我的应用程序。我的设备在Android Pie(8)上运行。

Expo android应用版本:2.11.1.10

我尝试在另一台设备上运行应用程序,但存在相同的问题

error screen 27.0.0不是有效的SDK版本。选项为31.0.0、32.0.0、33.0.0未版本

我的package.json如下所示:

{
  "name": "project",
  "version": "0.1.0",
  "private": true,
  "devDependencies": {
    "@types/jest": "^23.1.0",
    "@types/react": "^16.4.1",
    "@types/react-dom": "^16.0.6",
    "@types/react-native": "^0.55.21",
    "@types/react-navigation": "^2.0.5",
    "@types/react-redux": "^6.0.2",
    "@types/react-test-renderer": "^16.0.1",
    "jest-expo": "~27.0.0",
    "react-native-scripts": "1.14.0",
    "react-native-typescript-transformer": "^1.2.10",
    "react-test-renderer": "16.3.1",
    "tslib": "^1.9.2",
    "typescript": "^2.9.2"
  },
  "main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "eject": "expo eject"
  },
  "jest": {
    "preset": "jest-expo"
  },
  "dependencies": {
    "@types/expo": "^27.0.3",
    "@types/lodash": "^4.14.116",
    "axios": "^0.18.0",
    "expo": "^27.0.1",
    "lodash": "^4.17.11",
    "native-base": "^2.5.2",
    "react": "16.3.1",
    "react-native": "https://github.com/expo/react-native/archive/sdk-27.0.0.tar.gz",
    "react-native-animatable": "^1.3.0",
    "react-native-maps": "^0.21.0",
    "react-native-navigation": "^1.1.486",
    "react-native-router-flux": "^4.0.0-beta.31",
    "react-native-swipe-gestures": "^1.0.2",
    "react-navigation": "^2.7.0",
    "react-redux": "^5.0.7",
    "redux": "^4.0.0",
    "redux-saga": "^0.16.0"
  }
}

app.json看起来像:

{
  "expo": {
    "name": "Tream",
    "slug": "Tream",
    "version": "1.0.0",
    "orientation": "portrait",
    "sdkVersion": "27.0.0",
    "icon": "./src/assets/icon.png",
    "splash": {
      "image": "./src/assets/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "android": {
      "package": "com.treamcompany.tream"
    },
    "packagerOpts": {
      "sourceExts": ["ts", "tsx"],
      "transformer": "node_modules/react-native-typescript-transformer/index.js"
    }
  }
}

5 个答案:

答案 0 :(得分:1)

您需要更新博览会版本:

  1. npm install(用于节点模块)
  2. 博览会更新
  3. npm install react-native-gesture-handler --save
  4. npm开始

我遇到了同样的问题,但是我运行了上面的命令并获得了输出

答案 1 :(得分:0)

您可以在此处查看为什么发生这种情况的说明:https://blog.expo.io/updated-expo-client-available-on-app-store-and-play-store-8747bd3a1364

答案 2 :(得分:0)

对我来说解决方案是: “在您的app.json和package.json文件中,sdk版本应该相同”

 "expo": {
"name": "ThirdReactApp",
"slug": "Third-React-App",
"privacy": "public",
"sdkVersion": "33.0.0",
"platforms": [
  "ios",
  "android"
],

  "dependencies": {
    "expo": "^34.0.1",
    "react": "16.8.3",
    "react-dom": "^16.8.6",
    "react-native": "https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz",
    "react-native-web": "^0.11.4"
  },

答案 3 :(得分:0)

您设备上的Expo客户端可能是最新且良好的,但是您尝试加载的应用程序(项目)已过时。您只需要将您的应用程序(项目)更新为更新且兼容的SDK。就是说,请按照本网站上的说明进行操作,以获取逐步指南。

https://docs.expo.io/versions/latest/workflow/upgrading-expo-sdk-walkthrough/

答案 4 :(得分:0)

对于 27.0.0,您可以使用 Expo apk 2.10.6

https://d1ahtucjixef4r.cloudfront.net/Exponent-2.10.6.apk