yamill / react-native-orientation

Listen to device orientation changes in react-native and set preferred orientation on screen to screen basis.
https://www.npmjs.com/package/react-native-orientation
ISC License
1.72k stars 810 forks source link

App cannot be compiled unless compileSdk is set manually to 26 or higher #334

Open adriantache opened 5 years ago

adriantache commented 5 years ago

I have no idea why this needs all those visual elements, but the app won't compile unless I manually edit the build.gradle for react-native-orientation to use a compileSdk of 26.

adrian09h commented 5 years ago

I can not find the resource files in compileSDK of 28

kangkang721 commented 5 years ago

I can not find the resource files in compileSDK of 27

MateusAndrade commented 5 years ago

Is there any update about this problem? To build my application with the release config, i needed to ste the compileSdkVersion on ~/node_modules/react-native-orientation/android/build.gradle to 26.

Would be a problem, merge a PR setting this version to 26?

retyui commented 5 years ago

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

MateusAndrade commented 5 years ago

@retyui im already using this fork. I think this repo is dead. But because of the number of stars, or other thing this is the first repo that everyone finds. :(

adriantache commented 5 years ago

There is a simple solution for this, courtesy of @RoJoHub:

You can override this settings by adding a Project-wide gradle configuration 
properties for use by all modules in your ReactNative project by adding the 
below to android/build.gradle file,

buildscript {...}

allprojects {...}

/**
* Project-wide gradle configuration properties for use by all modules
*/
ext {
    compileSdkVersion           = 26
    targetSdkVersion            = 26
    buildToolsVersion           = "26.0.2"
    googlePlayServicesVersion   = "12.0.1"
    googlePlayServicesVisionVersion = "15.0.2"
    supportLibVersion           = "27.1.0"
}
retyui commented 5 years ago

@MateusAndrade we can mention all peoples who set star to this repo and tell them to unstar it )

retyui commented 5 years ago

@adriantache I have a better solution

android/build.gradle


subprojects { subProject ->
    afterEvaluate {
        if (subProject.hasProperty("android")) {
            android {
                buildToolsVersion "28.0.2"
                compileSdkVersion 28
            }
        }
    }
}
MateusAndrade commented 5 years ago

@retyui i think this is a good idea. Since this repo wont get any update for a long time. Another option would be open a issue warning to this problem, and showing the orientation-locker fork

RoJoHub commented 5 years ago

There is a simple solution for this, courtesy of @RoJoHub:

You can override this settings by adding a Project-wide gradle configuration 
properties for use by all modules in your ReactNative project by adding the 
below to android/build.gradle file,

buildscript {...}

allprojects {...}

/**
* Project-wide gradle configuration properties for use by all modules
*/
ext {
    compileSdkVersion           = 26
    targetSdkVersion            = 26
    buildToolsVersion           = "26.0.2"
    googlePlayServicesVersion   = "12.0.1"
    googlePlayServicesVisionVersion = "15.0.2"
    supportLibVersion           = "27.1.0"
}

YES.This is a good wat to solve.But must be support by author.


Also i think @retyui .That is good idea.

But we may need to pay attention to some side effects, because the configuration of all sub-projects has been changed.

MateusAndrade commented 5 years ago

@retyui @RoJoHub i created this issue #343 about this problem and the fact that this repo wasnt updated after a longe time. Hope it helps any off you guys! :)