beefe / react-native-picker

A Native Picker with high performance.
1.75k stars 786 forks source link

Build failed with an exception #372

Open Jeijie opened 5 years ago

Jeijie commented 5 years ago

FAILURE: Build failed with an exception.

React Native Environment Info: System: OS: Windows 7 CPU: (4) x64 Intel(R) Core(TM) i5-6400 CPU @ 2.70GHz Memory: 7.77 GB / 15.88 GB Binaries: Node: 8.12.0 - F:\install\nodejs\node.EXE Yarn: 1.9.4 - C:\Users\XXXX\AppData\Roaming\npm\yarn.CMD npm: 6.4.1 - F:\install\nodejs\npm.CMD

csumrell commented 5 years ago

I am also getting this with RN 59.1

a4averma commented 5 years ago

Go to node_modules/react-native-picker/build.gradle

change these values.

compileSdkVersion 28
buildToolsVersion "28.0.3"
targetSdkVersion 28

I was able to build successfully after I did that.

crastyle commented 5 years ago

edit android/build.gradle and after allprojects add code subprojects { afterEvaluate {project -> if (project.hasProperty("android")) { android { compileSdkVersion 28 // have to match with build.gradle and app/build.gradle ones buildToolsVersion '28.0.3' // have to match with build.gradle and app/build.gradle ones variantFilter { variant -> def names = variant.flavors*.name // To check for a certain build type, use variant.buildType.name == "<buildType>" if (names.contains("reactNative51") || names.contains("reactNative55") || names.contains("reactNative56")) { // Gradle ignores any variants that satisfy the conditions above. setIgnore(true) } } } } } }

castrolol commented 4 years ago

@crastyle code with format :


subprojects {
    afterEvaluate { project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion 28 // have to match with build.gradle and app/build.gradle ones
                buildToolsVersion '28.0.3'
                // have to match with build.gradle and app/build.gradle ones
                variantFilter { variant ->
                    def names = variant.flavors*.name // To check for a certain build type, use variant.buildType.name == "<buildType>"
                    if (names.contains("reactNative51") || names.contains("reactNative55") || names.contains("reactNative56")) {
                        // Gradle ignores any variants that satisfy the conditions above.
                        setIgnore(true)
                    }
                }
            }
        }
    }
}```