Open ekmobile opened 5 years ago
I also encountered this error. It seems that RN updated Android SDK to 28 in 0.58.* while this library still using 27.
FYI, there're some methods to fix it.
Modify compileSdkVersion
and targetSdkVersion
in file node_modules/react-native-picker/android/build.gradle
to 28 manually. Just make sure its value before every build.
Refactor the code in node_modules/react-native-picker/android/build.gradle
to get versions dynamically:
def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
android {
compileSdkVersion safeExtGet('compileSdkVersion', 27)
buildToolsVersion safeExtGet('buildToolsVersion', '23.0.1')
defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', 16)
targetSdkVersion safeExtGet('targetSdkVersion', 27)
// ...
}
// ...
}
And in your project's level build.gradle
, provide these values:
buildscript {
ext {
targetSdkVersion = 28
compileSdkVersion = 28
minSdkVersion = 19
}
// ...
}
Thank you @saplf. I created a PR with your suggestions: https://github.com/beefe/react-native-picker/pull/368 @ekegodigital 👍
After updating to React Native 0.58.3 the Android build is failing. See enclosed log file. There seem to be resources missing for Android 9.
android-build-failing.log