【问题标题】:React-native(android) AAPT: error: resource android:attr/dialogCornerRadius not foundReact-native(android) AAPT:错误:找不到资源 android:attr/dialogCornerRadius
【发布时间】:2019-07-14 12:43:28
【问题描述】:

运行 react-native run-android 后

我明白了

JS server already running.
Building and installing the app on the device (cd android && gradlew.bat 
installDebug)...
C:\Users\Dd\.gradle\caches\transforms-1\files-1.1\appcompat-v7- 
28.0.0.aar\5f8d067ae17f4050cbc3c86889ab0be8\res\values-v28\values- 
v28.xml:9:5-12:13: AAPT: error: resource android:attr/dialogCornerRadius not 
found.

c:\react\diagnoseme\android\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:11: AAPT: error: resource android:attr/dialogCornerRadius not found.

C:\Users\Dd\.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0.aar\5f8d067ae17f4050cbc3c86889ab0be8\res\values\values.xml:1304:5-69: AAPT: error: resource android:attr/fontVariationSettings not found.

C:\Users\Dd\.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0.aar\5f8d067ae17f4050cbc3c86889ab0be8\res\values\values.xml:1304:5-69: AAPT: error: resource android:attr/ttcIndex not found.

error: failed linking references.

FAILURE: Build failed with an exception.

* What went wrong:

任务“:app:processDebugResources”执行失败。 处理资源失败,详情见上面的 aapt 输出。

* Try:

使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。运行 --scan 以获得完整的见解。

* Get more help at https://help.gradle.org

在 22 秒内构建失败 61 个可操作的任务:1 个已执行,60 个最新 无法在设备上安装应用程序,请阅读上面的错误以了解详细信息。 确保您有一个正在运行的 Android 模拟器或连接的设备,并且有 设置您的 Android 开发环境: https://facebook.github.io/react-native/docs/getting-started.html

Command failed: gradlew.bat installDebug

Error: Command failed: gradlew.bat installDebug
at checkExecSyncError (child_process.js:616:11)
at Object.execFileSync (child_process.js:634:13)
at runOnAllDevices (C:\react\diagnoseme\node_modules\react-native\local-cli\runAndroid\runAndroid.js:299:19)
at buildAndRun (C:\react\diagnoseme\node_modules\react-native\local-cli\runAndroid\runAndroid.js:135:12)
at isPackagerRunning.then.result (C:\react\diagnoseme\node_modules\react-native\local-cli\runAndroid\runAndroid.js:65:12)
at process._tickCallback (internal/process/next_tick.js:68:7)

【问题讨论】:

  • 你解决了吗?我也有同样的问题...
  • @fnaquira 我刚刚更新了我的 android studio 和 graddle

标签: android android-studio react-native gradle


【解决方案1】:

这是因为您使用的是 appcompat-v7-28.0.0 和不匹配的编译 SDK 版本(很可能是 27)。降级库以匹配您的 SDK 或升级您的 SDK 以匹配您的库。

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2019-01-29
  • 2019-12-26
  • 2019-05-01
  • 1970-01-01
  • 2018-08-23
  • 1970-01-01
  • 2022-07-02
  • 2019-12-02
相关资源
最近更新 更多