代码之家  ›  专栏  ›  技术社区  ›  Mizlul

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

  •  4
  • Mizlul  · 技术社区  · 6 年前

    我的包.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"
      }
    }
    

    应用程序.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"
        }
      }
    }
    

    安卓生成.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'
        ]
      }
    

    你知道为什么这在安卓系统上不起作用了吗?

    注意:在我拥有26.0.0版之前,我也将targetSdkVersion设置为26,在更新了expo之后,我还将targetSdkVersion更新为27

    4 回复  |  直到 5 年前
        1
  •  14
  •   trojek    6 年前

        2
  •  9
  •   Sameer    6 年前

    更新了android play store的移动博览会应用程序。它对我有用。

        3
  •  3
  •   Martin Zeitler    6 年前

    upgrade walk-trough ...

    {
        "react-native": "https://github.com/expo/react-native/archive/sdk-31.0.0.tar.gz",
        "expo": "^31.0.0",
        "react": "16.5.0"
    }
    

    sdkVersion

    "sdkVersion": "26.0.0"
    

    目前的最大值是 28.0.0 26.0.0 ,这应该是可以使用的。

        4
  •  1
  •   Aljohn Yamaro    5 年前

    很好的一天,

    这是有效的

    1. 如果您使用的是android studio

    在虚拟android设备中卸载expo。 要卸载,可以在中删除虚拟设备 Android虚拟 设备管理器 让一切都焕然一新。 重新安装虚拟设备

    1. 如果你使用的是真正的android设备

    找到世博会并卸载它。

        5
  •  0
  •   Áron Géczy    6 年前

    在里面 package.json

    "expo": "^31.0.6",
    "expokit": "31.0.2",
    "react": "16.5.0",
    "react-native": "https://github.com/expo/react-native/archive/sdk-31.0.1.tar.gz",
    

    app.json

    "sdkVersion": "31.0.0"

    看到 upgrade walk-through

        6
  •  0
  •   ofundefined    5 年前

    此步骤适用于弹出的世博项目:

    如果你跑了 expo update 35.0.0 或其他版本,它没有解决错误,如果你已经弹出你的世博项目。。。

    app.json . 请注意URL上的sdk编号 iosExpoViewURL androidExpoViewURL 钥匙。

    "detach": {
      "iosExpoViewUrl": "https://s3.amazonaws.com/exp-exponent-view-code/ios-v2.13.0-sdk35.0.0-a30ebc9b-3db4-42f4-b677-e468076baf18.tar.gz",
      "androidExpoViewUrl": "https://s3.amazonaws.com/exp-exponent-view-code/android-v2.13.0-sdk35.0.0-b816b7af-88da-4ca9-87a5-7438f0c21b6e.tar.gz"
    }
    
        7
  •  0
  •   saifur    5 年前

    我也面临同样的问题问题。那个通过在Android设备上清除Expo应用程序的数据和缓存,解决了这个问题。现在一切正常。

        8
  •  0
  •   anesupaul-developer    5 年前

    要解决此问题,只需迁移到node和expo cli的最新版本。在手机上卸载expo,然后从app store重新安装。你该走了。

        9
  •  -1
  •   Daggie Blanqx - Douglas Mwangi    6 年前

    我安装了一个旧版本的世博应用程序,解决了这个问题 (您可以在上找到旧版本的playstore应用程序 apkpure.com )