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 809 forks source link

Execution failed for task ':react-native-orientation:verifyReleaseResources' #290

Open harikanammi opened 6 years ago

harikanammi commented 6 years ago

Hi, i am running sample application. I am using this module it's working fine in iOS and Android. My question is..... when i build an apk file in android i am getting error like below image. Please give me any suggestion. Thank you in advance.

  "react": "16.3.1",
    "react-native": "0.55.4",
    "react-native-orientation": "^3.1.3",
    "react-native-router-flux": "^4.0.0-beta.31"

screen shot 2018-05-22 at 4 40 31 pm

Doodidan commented 6 years ago

@harikanammi Did you find any solution?

harikanammi commented 6 years ago

@GoshaEgorian, Please follow the manual linking of android. I think It will be helpful to you. https://github.com/yamill/react-native-orientation (or) can u check this once..... https://github.com/react-native-community/react-native-svg/issues/585

Luisda199824 commented 6 years ago

@harikanammi If you see into node_modules/react-native-orientation/android/build.gradle, you see that:

######### apply plugin: 'com.android.library'

android { compileSdkVersion 23 buildToolsVersion "23.0.1"

defaultConfig {
    minSdkVersion 16
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
    ndk {
        abiFilters "armeabi-v7a", "x86"
    }
}

}

dependencies { compile "com.facebook.react:react-native:+" } #########

I changed it to: ######### apply plugin: 'com.android.library'

android { compileSdkVersion 26 buildToolsVersion '26.0.2'

defaultConfig {
    minSdkVersion 16
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
}

}

dependencies { implementation 'com.android.support:appcompat-v7:26.0.2' compile "com.facebook.react:react-native:+" } #########

And this worked for me

kjs104901 commented 6 years ago

@Luisda199824 Thanks. It works for me.

nuocgansoi commented 6 years ago

@Luisda199824 thanks.

Other solution: Add subprojects {} to android/build.gradle:

buildscript {
    ext {
        buildToolsVersion = "27.0.3"    // version of build tool used for project
        minSdkVersion = 16
        compileSdkVersion = 27         // version of compile sdk used for project
        targetSdkVersion = 26
        supportLibVersion = "27.1.1"
    }
    repositories {
       ...
    }
    dependencies {
       ...
    }
}

allprojects {
    ...
}

subprojects {
    afterEvaluate { project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion 27        // version of compile sdk used for project
                buildToolsVersion '27.0.3'    // version of build tool used for project
            }
        }
    }
}

task wrapper(type: Wrapper) {
    ...
}
LucasMMota commented 6 years ago

@nuocgansoi solution worked for me!

retyui commented 6 years ago

This repo dead , use the fork https://github.com/wonday/react-native-orientation-locker

deepak-jha-kgp commented 5 years ago

Another Solution: Use ./gradlew app:assembleRelease

ddxxtony commented 5 years ago

Another Solution: Use ./gradlew app:assembleRelease

Hi Could you please explain why is this working ?

SLSJL commented 4 years ago

Another Solution: Use ./gradlew app:assembleRelease

Hi, would you mind providing some details about why this works? But grandlew assembleRelease doesn't.

verybluebot commented 4 years ago

only updating too:

    compileSdkVersion 28
    buildToolsVersion "28.0.1"

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 28

with the rest of @Luisda199824 update worked for me

robertwubs commented 4 years ago

Since Google now forces everyone to use SDK version 29, this repo is indeed not usable anymore sadly.

ejderlee commented 2 years ago

@nuocgansoi insan değilsin melek melek. thx my friend