无法完成Gradle Build,链接引用失败 [英] Cannot complete Gradle Build, failed linking references

查看:227
本文介绍了无法完成Gradle Build,链接引用失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载了一个包含3个模块的项目,尝试构建它后,我从gradlew assembleDebug--scan中获得了以下信息:

I downloaded a project with 3 modules, after trying to build it I get the following from gradlew assembleDebug--scan:

无法处理资源,有关详细信息,请参见上面的aapt输出.

Failed to process resources, see aapt output above for details.

问题是,据我所知,在build文件夹中的values.xml文件中,这意味着我无法更改它.我究竟做错了什么?.

The problem is, that as far as I can see, in a values.xml file in the build folder, meaning I can't change it. What am I doing wrong?.

>error: style attribute '@android:attr/windowBackground' not found.
Message{kind=ERROR, text=error: style attribute '@android:attr/windowBackground' not found., sources=[C:\Users\Charorfa\Downloads\atlas-contentcollector-forgroup\ATLASContentCollector\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:253], original message=, tool name=Optional.of(AAPT)}

>error: style attribute '@android:attr/textColor' not found.
Message{kind=ERROR, text=error: style attribute '@android:attr/textColor' not found., sources=[C:\Users\Charorfa\Downloads\atlas-contentcollector-forgroup\ATLASContentCollector\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:254], original message=, tool name=Optional.of(AAPT)}

同步说

配置'compile'已过时,并已由'implementation'代替. 它将在2018年底删除

Configuration 'compile' is obsolete and has been replaced with 'implementation'. It will be removed at the end of 2018

但是我认为这更多的是警告,而不是错误.

but I think it is more of a warning, than an error.

我也找到了这个,但是我不知道它是否可以帮助我

I also found this, but I don't know if it can help me

错误:链接引用失败. ->排队的工作

推荐答案

这可能是因为您尝试通过以下方式为样式使用不存在的属性:

This is probably because you're trying using non-existent attribute for your style with:

@android:attr/windowBackground

@android:attr/textColor

相反,您需要像以下样式一样使用android:windowBackgroundandroid:textColor:

Instead, you need to use android:windowBackground and android:textColor like in the following style:

  <style name="DontCopyMyStyle" parent="AppTheme">
    <item name="android:windowBackground">@android:color/black</item>
    <item name="android:textColor">@android:color/white</item>
  </style>

这篇关于无法完成Gradle Build,链接引用失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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