执行 react-native run-android 时任务:app:processDebugResources FAILED
Posted
技术标签:
【中文标题】执行 react-native run-android 时任务:app:processDebugResources FAILED【英文标题】:Task :app:processDebugResources FAILED when doing react-native run-android 【发布时间】:2021-05-03 00:50:02 【问题描述】:我在使用 react-native run-android 构建我的应用时遇到以下错误:
任务:app:processDebugResources 失败
此版本中使用了已弃用的 Gradle 功能,使其与 Gradle 7.0 不兼容。 使用“--warning-mode all”显示各个弃用警告。 见https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings 195 个可操作的任务:2 个已执行,193 个是最新的
FAILURE:构建失败并出现异常。
出了什么问题: 任务“:app:processDebugResources”执行失败。执行 com.android.build.gradle.internal.tasks.Workers$ActionFacade 时发生故障 Android资源链接失败 /Users/prikshetsharma/.gradle/caches/transforms-2/files-2.1/863e0c3c6716935cd3657ad638fd992d/material-1.1.0/res/values/values.xml:528:5-593:11:AAPT:错误:样式属性'android :attr/contextPopupMenuStyle' 未找到。
/Users/prikshetsharma/.gradle/caches/transforms-2/files-2.1/863e0c3c6716935cd3657ad638fd992d/material-1.1.0/res/values/values.xml:642:5-699:11: AAPT: error: style attribute 'android:attr/contextPopupMenuStyle' not found.
/Users/prikshetsharma/.gradle/caches/transforms-2/files-2.1/863e0c3c6716935cd3657ad638fd992d/material-1.1.0/res/values/values.xml:748:5-812:11: AAPT: error: style attribute 'android:attr/contextPopupMenuStyle' not found.
/Users/prikshetsharma/.gradle/caches/transforms-2/files-2.1/863e0c3c6716935cd3657ad638fd992d/material-1.1.0/res/values/values.xml:909:5-966:11: AAPT: error: style attribute 'android:attr/contextPopupMenuStyle' not found.
/Users/prikshetsharma/.gradle/caches/transforms-2/files-2.1/863e0c3c6716935cd3657ad638fd992d/material-1.1.0/res/values/values.xml:1023:5-1034:11: AAPT: error: style attribute 'android:attr/dialogCornerRadius' not found.
/Users/prikshetsharma/.gradle/caches/transforms-2/files-2.1/1cb9b9ea592aa2ea85233be252327dcf/appcompat-1.1.0/res/values-v26/values-v26.xml:5:5-8:13: AAPT: error: resource android:attr/colorError not found.
/Users/prikshetsharma/.gradle/caches/transforms-2/files-2.1/1cb9b9ea592aa2ea85233be252327dcf/appcompat-1.1.0/res/values-v26/values-v26.xml:9:5-12:13: AAPT: error: resource android:attr/colorError not found.
/Users/prikshetsharma/.gradle/caches/transforms-2/files-2.1/1cb9b9ea592aa2ea85233be252327dcf/appcompat-1.1.0/res/values-v26/values-v26.xml:13:5-16:13: AAPT: error: style attribute 'android:attr/keyboardNavigationCluster' not found.
/Users/prikshetsharma/.gradle/caches/transforms-2/files-2.1/1cb9b9ea592aa2ea85233be252327dcf/appcompat-1.1.0/res/values-v28/values-v28.xml:5:5-8:13: AAPT: error: resource android:attr/dialogCornerRadius not found.
/Users/prikshetsharma/.gradle/caches/transforms-2/files-2.1/1cb9b9ea592aa2ea85233be252327dcf/appcompat-1.1.0/res/values-v28/values-v28.xml:9:5-12:13: AAPT: error: resource android:attr/dialogCornerRadius not found.
/Users/prikshetsharma/.gradle/caches/transforms-2/files-2.1/1cb9b9ea592aa2ea85233be252327dcf/appcompat-1.1.0/res/values-v23/values-v23.xml:38:5-41:13: AAPT: error: style attribute 'android:attr/hyphenationFrequency' not found.
/Users/prikshetsharma/.gradle/caches/transforms-2/files-2.1/1cb9b9ea592aa2ea85233be252327dcf/appcompat-1.1.0/res/values-v23/values-v23.xml:38:5-41:13: AAPT: error: style attribute 'android:attr/breakStrategy' not found.
/Users/prikshetsharma/.gradle/caches/transforms-2/files-2.1/1cb9b9ea592aa2ea85233be252327dcf/appcompat-1.1.0/res/values-v23/values-v23.xml:45:5-48:13: AAPT: error: style attribute 'android:attr/hyphenationFrequency' not found.
/Users/prikshetsharma/.gradle/caches/transforms-2/files-2.1/1cb9b9ea592aa2ea85233be252327dcf/appcompat-1.1.0/res/values-v23/values-v23.xml:45:5-48:13: AAPT: error: style attribute 'android:attr/breakStrategy' not found.
/Users/prikshetsharma/.gradle/caches/transforms-2/files-2.1/7ce8a2eb9e81825ec9bcc373c597a746/cardview-1.0.0/res/values-v23/values-v23.xml:3:5-5:13: AAPT: error: resource android:attr/colorBackgroundFloating not found.
/Users/prikshetsharma/.gradle/caches/transforms-2/files-2.1/863e0c3c6716935cd3657ad638fd992d/material-1.1.0/res/values/values.xml:1709:5-1716:11: AAPT: error: style attribute 'android:attr/keyboardNavigationCluster' not found.
尝试: 使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。运行 --scan 以获得完整的见解。
通过https://help.gradle.org获得更多帮助
在 5 秒内构建失败
错误 无法安装应用程序。确保您已设置 Android 开发环境:https://reactnative.dev/docs/environment-setup。使用 --verbose 标志运行 CLI 以获取更多详细信息。 错误:命令失败:./gradlew app:installDebug -PreactNativeDevServerPort=8081
如何解决这个错误?
【问题讨论】:
你弄明白了吗? 【参考方案1】:事实证明,我不得不在一个模块中增加我的 compileSdkVersion(LVL 许可)。非常烦人,因为错误出现在完全不同的模块下。
【讨论】:
以上是关于执行 react-native run-android 时任务:app:processDebugResources FAILED的主要内容,如果未能解决你的问题,请参考以下文章
如何解决使用 react-native 构建 APK 时无法执行 aapt 的错误?
尝试执行 react-native 应用程序时出现“错误无法读取未定义的属性‘拆分’”
当应用程序被杀死时,在推送通知后执行操作:react-native,IOS
在下面执行 npm install gettng 时出现 react-native 错误