首页 > 解决方案 > 27.0.0 不是有效的 SDK 版本。选项是 31.0.0、32.0.0、33.0.0 未版本化

问题描述

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

世博安卓app版本:2.11.10

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

错误屏幕 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"
    }
  }
}

标签: react-nativereact-native-androidexpo

解决方案


您需要更新您的博览会版本:

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

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


推荐阅读