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

Mizlul picture Mizlul · Nov 27, 2018 · Viewed 13.9k times · Source

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.

Answer

trojek picture trojek · Dec 3, 2018

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