React-native-orientation: App not supporting android higher versions. [SOLUTION INCLUEDED]

Created on 20 Dec 2018  路  3Comments  路  Source: yamill/react-native-orientation

Please update ../android/build.gradle file and replace code with this for higher Android versions

buildscript {
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'
    }
}

apply plugin: 'com.android.library'

def _ext = rootProject.ext

def _reactNativeVersion = _ext.has('reactNative') ? _ext.reactNative : '+'
def _compileSdkVersion = _ext.has('compileSdkVersion') ? _ext.compileSdkVersion : 27
def _buildToolsVersion = _ext.has('buildToolsVersion') ? _ext.buildToolsVersion : '27.0.3'
def _minSdkVersion = _ext.has('minSdkVersion') ? _ext.minSdkVersion : 16
def _targetSdkVersion = _ext.has('targetSdkVersion') ? _ext.targetSdkVersion : 27

android {
    compileSdkVersion _compileSdkVersion
    buildToolsVersion _buildToolsVersion

    defaultConfig {
        minSdkVersion _minSdkVersion
        targetSdkVersion _targetSdkVersion
        versionCode 1
        versionName "1.0"
    }
    lintOptions {
        abortOnError false
    }
}

dependencies {
    //noinspection GradleDynamicVersion
    implementation "com.facebook.react:react-native:${_reactNativeVersion}"
}

Most helpful comment

Use a fork react-native-orientation-locker with normal support ! :+1:

All 3 comments

I have set up a project last week with latest version of react native (Android SDK version 27) and have the same issue.
In my opinion this will help to solve version incompatibility.

Use a fork react-native-orientation-locker with normal support ! :+1:

@retyui I uninstall react-native-orientation and install react-native-orientation-locker and works fine for me, thank you.

Was this page helpful?
0 / 5 - 0 ratings