获得"verifyReleaseResources".升级React Native后出现错误 [英] Getting "verifyReleaseResources" error after upgrading React Native
问题描述
我正在尝试将应用程序升级到React Native 0.57.1.我想我已经按照所有步骤操作,升级了所有正确的文件,但是仍然出现我无法理解的错误:
I'm trying to upgrade an application to React Native 0.57.1. I think I've followed all the steps, upgraded all the right files, yet I'm still getting an error that I cannot understand:
:react-native-document-picker:compileReleaseSources UP-TO-DATE
:react-native-document-picker:mergeReleaseResources UP-TO-DATE
:react-native-document-picker:verifyReleaseResourcesC:\Users\USERNAME\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar\b3b5480809d523e6f8b8de92faafbcda\res\values-v26\values-v26.xml:9:5-12:13: AAPT: error: resource android:attr/colorError not found.
C:\Users\USERNAME\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar\b3b5480809d523e6f8b8de92faafbcda\res\values-v26\values-v26.xml:13:5-16:13: AAPT: error: resource android:attr/colorError not found.
C:\Users\USERNAME\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar\b3b5480809d523e6f8b8de92faafbcda\res\values-v26\values-v26.xml:17:5-93: AAPT: error: style attribute 'android:attr/keyboardNavigationCluster' not found.
C:\Users\USERNAME\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar\b3b5480809d523e6f8b8de92faafbcda\res\values\values.xml:251:5-69: AAPT: error: resource android:attr/fontStyle not found.
C:\Users\USERNAME\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar\b3b5480809d523e6f8b8de92faafbcda\res\values\values.xml:251:5-69: AAPT: error: resource android:attr/font not found.
C:\Users\USERNAME\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar\b3b5480809d523e6f8b8de92faafbcda\res\values\values.xml:251:5-69: AAPT: error: resource android:attr/fontWeight not found.
error: failed linking references.
:react-native-document-picker:verifyReleaseResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-document-picker:verifyReleaseResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
我无法真正理解这些错误,知道它们是什么意思吗?我如何找出解决方法?
I can't really make sense of these errors, any idea what they mean? How can I find out how to fix this?
我尝试了各种操作,包括删除.cache目录,更改gradle版本,但似乎无济于事.有什么主意吗?
I've tried various things, including deleting the .cache directory, changing the gradle version but nothing seems to help. Any idea?
推荐答案
您需要在项目的android/build.gradle中添加以下代码:
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"
}
}
}
}
这篇关于获得"verifyReleaseResources".升级React Native后出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!