Build failed with an exception
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':react-native-picker:verifyReleaseResources'.
java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2. Aapt2Exception: Android resource linking failed G:\xxxxx\node_modules\react-native-picker\android\build\intermediates\res\m erged\release\values-v28\values-v28.xml:7: error: resource android:attr/dialogCo rnerRadius not found. G:\xxxxx\node_modules\react-native-picker\android\build\intermediates\res\m erged\release\values-v28\values-v28.xml:11: error: resource android:attr/dialogC ornerRadius not found. G:\xxxxx\node_modules\react-native-picker\android\build\intermediates\res\m erged\release\values\values.xml:2727: error: resource android:attr/fontVariation Settings not found. G:\xxxxx\node_modules\react-native-picker\android\build\intermediates\res\m erged\release\values\values.xml:2728: error: resource android:attr/ttcIndex not found. error: failed linking references.
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
I am also getting this with RN 59.1
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.
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) } } } } } }
@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)
}
}
}
}
}
}```