【问题标题】:Execution failed for task ':app:processDebugResources'. React Native [duplicate]任务 ':app:processDebugResources' 执行失败。反应本机[重复]
【发布时间】:2019-08-04 12:18:07
【问题描述】:

我在“react-native run-android”上遇到了这个问题。我没有像 2 个月那样使用我的代码。今天,我不得不进行一些更改。但我无法在模拟器上运行。

JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...

> Configure project :app 
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

> Configure project :react-native-image-crop-picker 
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

/Users/{{username}}/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/8ff87d77ddde6374a9d9faf5f292366f/res/values/values.xml:251:5-69: AAPT: error: resource android:attr/fontVariationSettings not found.

/Users/{{username}}/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/8ff87d77ddde6374a9d9faf5f292366f/res/values/values.xml:251:5-69: AAPT: error: resource android:attr/ttcIndex not found.

error: failed linking references.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Failed to process resources, see aapt output above for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

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

BUİLD FAILED in 2s
53 actionable tasks: 1 executed, 52 up-to-date
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html

android/build.gradle

ext {
        buildToolsVersion = "27.0.3"
        minSdkVersion = 16
        compileSdkVersion = 27
        targetSdkVersion = 26
        supportLibVersion = "27.1.1"
    }

【问题讨论】:

  • 尝试删除 android/app/ 中的 build 文件夹并再次尝试构建项目。
  • 同样的错误,遗憾的是没有区别
  • error: failed linking references. 前两行是错误,其他是警告。请检查那些参考

标签: android react-native android-gradle-plugin


【解决方案1】:

尝试将 compileSdkVersion 更改为:

compileSdkVersion 28

fontVariationSettings 是 api 级别 28。Source

【讨论】:

    猜你喜欢
    • 2020-02-28
    • 2019-10-31
    • 2021-05-29
    • 1970-01-01
    • 2018-03-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-01-23
    相关资源
    最近更新 更多