Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

31.0.0 is not a valid SDK Version. Option are 26.0.0 Unversioned

I can no longer run my app after updating expo version to 31.0.0. I needed this upgrade to do due iOS version 12 support. Thou after trying to build the Android app it is no longer working.

my package.json looks as below:

{
  "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"
  }
}

app.json looks like:

{
  "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"
    }
  }
}

Android build.gradle app looks like this.:

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'
    ]
  }

Any idea why this is not working on Android anymore?

NOte: before i had expo 26.0.0 I also had targetSdkVersion to 26, after updating expo I also updated targetSdkVersion to 27

UPDATE: This error occurs on emulator, I havent yet tried on real device, but I have the feeling that the same would be on real device too.

like image 866
Mizlul Avatar asked Nov 27 '18 22:11

Mizlul


People also ask

How do I check SDK version?

This can be found under the menu TOOLS -> Android -> Android SDK Manager.

What version of Android is SDK 21?

Initial release for Android 5.0 (API level 21).

What is the SDK version of Android 4.4 2?

The Android Mobile Messaging SDK version 4.4. 2 uses: Minimum API version 19. Compile API version 28.


3 Answers

You have to uninstall and then install the Expo on your Android device.

like image 90
trojek Avatar answered Nov 11 '22 07:11

trojek


Updated mobile expo app from play-store in android. It worked for me.

like image 26
Sameer Avatar answered Nov 11 '22 05:11

Sameer


see the 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"
}

that sdkVersion which you've changed, most likely is the Android SDK version and should be:

"sdkVersion": "26.0.0"

the current maximum would be 28.0.0, but when it asks for 26.0.0, this should possibly be used.

like image 21
Martin Zeitler Avatar answered Nov 11 '22 05:11

Martin Zeitler