31.0.0不是有效的SDK版本。选项是26.0.0未版本化

Miz*_*lul 8 java android android-studio react-native-android android-studio-3.0

将expo版本更新为31.0.0后,我无法再运行我的应用程序。我需要此升级才能提供iOS 12版本的支持。尝试构建Android应用后,您将无法再使用它。

我的package.json如下所示:

{
  "name": "myapp",
  "version": "0.1.0",
  "private": true,
  "devDependencies": {
    "react-native-scripts": "1.13.1",
    "jest-expo": "^31.0.0",
    "react-test-renderer": "16.3.0-alpha.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": "^31.0.4",
    "react": "16.5.0",
    "react-native": "https://github.com/expo/react-native/archive/sdk-31.0.1.tar.gz",
    "react-native-image-slider": "^2.0.3",
    "react-native-onesignal": "^3.1.4",
    "react-native-progress": "^3.4.0",
    "react-native-render-html": "^3.9.3",
    "react-navigation": "^1.5.11"
  }
}
Run Code Online (Sandbox Code Playgroud)

app.json看起来像:

{
  "expo": {
    "sdkVersion": "31.0.0",
    "name": "myapp",
    "slug": "myapp",
    "version": "0.1.1",
    "isDetached": true,
    "detach": {
      "scheme": "expe6b74e69f7904f4b8961fc359e0dc1ce",
      "androidExpoViewUrl": "https://s3.amazonaws.com/exp-exponent-view-code/android-v2.4.0-sdk26.0.0-e63d9209-070c-4118-b06b-c60e82da0b66.tar.gz"
    },
    "android": {
      "package": "com.myapp"
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

Android build.gradle应用程序如下所示:

android {
  compileSdkVersion 27
  buildToolsVersion '26.0.1'

  defaultConfig {
    applicationId 'com.ferrometal12'
    targetSdkVersion 27
    versionCode 1
    versionName '0.1.1'
    ndk {
      abiFilters 'armeabi-v7a', 'x86'
    }
    multiDexEnabled true
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    // Deprecated. Used by net.openid:appauth
    manifestPlaceholders = [
      'appAuthRedirectScheme': 'host.exp.exponent'
    ]
  }
Run Code Online (Sandbox Code Playgroud)

知道为什么它不能再在Android上运行了吗?

注意:在26.0.0世博会之前,我也将targetSdkVersion设置为26,在更新世博会后,我还将targetSdkVersion也更新到了27

更新:此错误发生在模拟器上,我还没有在真实设备上尝试过,但是我有同样的感觉。

tro*_*jek 16

您必须卸载并在您的 Android 设备上安装 Expo。

  • @Mizlul,当我们选择“在 Android 设备/模拟器上运行”时,expo 首先在模拟器上安装“Expo”应用程序,然后执行该应用程序。当 Expo-CLI 和 Expo App 更新时会发生这种情况。您只需从模拟器中卸载 Expo App 并运行该项目(npm start),它就会在您的模拟器上安装 Expo App 的更新版本。安卓手机也是一样,需要更新手机上的Expo App (2认同)

小智 9

从安卓游戏商店更新了移动博览会应用程序。它对我有用。