React Native aapt: error: resource android:
aapt: error: resource android:attr/colorerror not found. React Native Error Fix
You can come across aapt: error: resource android:attr/colorerror not found. error while building your react native Android app or while generating release APK file from your React Native project.
============= ERROR APPEAR ==================
> Task :react-native-geocoder:verifyReleaseResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ‘:react-native-geocoder:verifyReleaseResources’.
> java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
/projects/entrivo/git/node_modules/react-native-geocoder/android/build/intermediates/res/merged/release/values-v26/values-v26.xml:7: error: resource android:attr/colorError not found.
/projects/entrivo/git/node_modules/react-native-geocoder/android/build/intermediates/res/merged/release/values-v26/values-v26.xml:11: error: resource android:attr/colorError not found.
/projects/entrivo/git/node_modules/react-native-geocoder/android/build/intermediates/res/merged/release/values-v26/values-v26.xml:15: error: style attribute ‘android:attr/keyboardNavigationCluster’ not found.
Get Raja R’s stories in your inbox
Join Medium for free to get updates from this writer.
/projects/entrivo/git/node_modules/react-native-geocoder/android/build/intermediates/res/merged/release/values-v28/values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
/projects/entrivo/git/node_modules/react-native-geocoder/android/build/intermediates/res/merged/release/values-v28/values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
/projects/entrivo/git/node_modules/react-native-geocoder/android/build/intermediates/res/merged/release/values/values.xml:2711: error: resource android:attr/fontStyle not found.
/projects/entrivo/git/node_modules/react-native-geocoder/android/build/intermediates/res/merged/release/values/values.xml:2712: error: resource android:attr/font not found.
/projects/entrivo/git/node_modules/react-native-geocoder/android/build/intermediates/res/merged/release/values/values.xml:2713: error: resource android:attr/fontWeight not found.
/projects/entrivo/git/node_modules/react-native-geocoder/android/build/intermediates/res/merged/release/values/values.xml:2714: error: resource android:attr/fontVariationSettings not found.
/projects/entrivo/git/node_modules/react-native-geocoder/android/build/intermediates/res/merged/release/values/values.xml:2715: error: resource android:attr/ttcIndex not found.
error: failed linking references.
============= ERROR END ==================
This issue occurs when third-party libraries use compileSdkVersion and buildToolsVersion less than 26.
You can solve this react native issue by forcing sub-projects to use SDK version greater than 28. Just open android/build.gradle file and add the following code inside allprojects tag.
allprojects {
repositories {
google()
mavenLocal()
jcenter()
maven {
url "$rootDir/../node_modules/react-native/android"
}
}
//add the folllowing lines to force libs to use recent buildtools
subprojects {
afterEvaluate {
project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion = 28
buildToolsVersion = "28.0.3"
}
}
}
}
}





