react-native-picker
react-native-picker copied to clipboard
打包的时候报错
- 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 E:\Projects\APP\YDJW\node_modules\react-native-picker\android\build\intermediates\res\merged\release\values-v28\values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found. E:\Projects\APP\YDJW\node_modules\react-native-picker\android\build\intermediates\res\merged\release\values-v28\values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found. E:\Projects\APP\YDJW\node_modules\react-native-picker\android\build\intermediates\res\merged\release\values\values.xml:2727: error: resource android:attr/fontVariationSettings not found. E:\Projects\APP\YDJW\node_modules\react-native-picker\android\build\intermediates\res\merged\release\values\values.xml:2728: error: resource android:attr/ttcIndex not found. error: failed linking references.
#368 👆 this may help to solve this issue ~
You need to add following code in your project's android/build.gradle:
subprojects {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion 27
buildToolsVersion "27.0.2"
}
}
}
}
Have you solved this problem?
Updating node_modules/react-native-picker/android/build.gradle
sdk version to 28( using React Native 0.59.5) fixes it.
android {
compileSdkVersion 28
//buildToolsVersion "23.0.1"
defaultConfig {
minSdkVersion 16
targetSdkVersion 28
@LostChrs 谢谢你的帮助!解決了
Updating
node_modules/react-native-picker/android/build.gradle
sdk version to 28( using React Native 0.59.5) fixes it.android { compileSdkVersion 28 //buildToolsVersion "23.0.1" defaultConfig { minSdkVersion 16 targetSdkVersion 28
it is working for me
def safeExtGet(prop, fallback) { rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback } android { compileSdkVersion safeExtGet('compileSdkVersion', 27) buildToolsVersion safeExtGet('buildToolsVersion', '23.0.1') ... }