错误 - Android资源链接失败(AAPT2 27.0.3守护进程#0) [英] Error - Android resource linking failed (AAPT2 27.0.3 Daemon #0)

查看:1854
本文介绍了错误 - Android资源链接失败(AAPT2 27.0.3守护进程#0)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个错误

我尝试重新安装android studio并删除.gradle文件夹,请解决任何问题?

 错误:FAILURE:构建失败,出现异常。 

*出错:
任务':app:processDebugResources'的执行失败。
> Android资源链接失败(AAPT2 27.0.3守护进程#0)
命令:C:\javasdk\build-tools\27.0.3\aapt2.exe链接-I\
C: \javasdk\platforms\android-26\android.jar\
--manifest\



C:\ Users \ Jalal D\.gradle\caches\transforms-1\files-1.1\ontonthe-0.1.8.aar\2b09376fc14469ba65fc8e4d85c2eed1\res\values\values.xml:19:5-25:25 :AAPT:错误:找不到资源android:attr / fontVariationSettings。

C:\Users\Jalal D\.gradle\caches\transforms-1\files-1.1\ontonthe-0.1.8.aar\2b09376fc14469ba65fc8e4d85c2eed1\res\\ \\ values \values.xml:19:5-25:25:AAPT:错误:找不到资源android:attr / ttcIndex。

错误:链接引用失败。

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

*通过https://help.gradle.org获取更多帮助

1m 3s建造失败


解决方案

有完全相同的问题。通过执行以下操作来解决它:
使用 com.android.support:support-v4:27.1.0搜索并替换 com.android.support:support-v4:+ 在platform / android目录中。



另外,我必须将以下代码添加到platforms / android / app / build.gradle和platforms / android / build.gradle文件:

  configurations.all {
resolutionStrategy {
force'com.android.support :support-v4:27.1.0'
}}

编辑回答Where is这个com.android.support:support-v4:+设置? ...

这个设置可能(在这种情况下)是在platform / android /目录中的一个插件的.gradle文件中,例如在我的情况下是starter-barcodescanner插件,所以只需浏览所有插件。格式文件:



仔细检查platforms / android / build.gradle文件。



希望这有助于。


I have this error

I am try reinstall android studio and remove .gradle folder , any solution please?

    Error:FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Android resource linking failed (AAPT2 27.0.3 Daemon #0)
  Command: C:\javasdk\build-tools\27.0.3\aapt2.exe link -I\
          C:\javasdk\platforms\android-26\android.jar\
          --manifest\



  C:\Users\Jalal D\.gradle\caches\transforms-1\files-1.1\fonticon-0.1.8.aar\2b09376fc14469ba65fc8e4d85c2eed1\res\values\values.xml:19:5-25:25: AAPT: error: resource android:attr/fontVariationSettings not found.

  C:\Users\Jalal D\.gradle\caches\transforms-1\files-1.1\fonticon-0.1.8.aar\2b09376fc14469ba65fc8e4d85c2eed1\res\values\values.xml:19:5-25:25: AAPT: error: resource android:attr/ttcIndex not found.

  error: failed linking references.

* 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

BUILD FAILED in 1m 3s

解决方案

Had exactly the same problem. Solved it by doing the following: Searching for and replacing com.android.support:support-v4:+ with com.android.support:support-v4:27.1.0 in the platform/android directory.

Also I had to add the following code to the platforms/android/app/build.gradle and platforms/android/build.gradle files:

configurations.all {
resolutionStrategy {
    force 'com.android.support:support-v4:27.1.0'
}}

Edited to answer "Where is this com.android.support:support-v4:+ setting ?" ...

The setting will probably(in this case) be in one of your plugin's .gradle file in the platform/android/ directory, for example in my case it was the starter-barcodescanner plugin so just go through all your plugins .gradle files :

Double check the platforms/android/build.gradle file.

Hope this helps.

这篇关于错误 - Android资源链接失败(AAPT2 27.0.3守护进程#0)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆