链接引用失败-样式属性'@android:attr/textColor';在appcompat中找不到
我试图从我们的项目中去掉即将被删除的选项链接引用失败-样式属性'@android:attr/textColor';在appcompat中找不到,android,android-gradle-plugin,android-appcompat,android-styles,Android,Android Gradle Plugin,Android Appcompat,Android Styles,我试图从我们的项目中去掉即将被删除的选项android.enableApt2=false。这很痛苦,但我希望我能做到 现在我遇到了一个构建异常:无法处理资源,请参阅上面的aapt输出以了解详细信息 问题似乎是这样的: error: style attribute '@android:attr/textColor' not found. Message{kind=ERROR, text=error: style attribute '@android:attr/textColor' not fou
android.enableApt2=false
。这很痛苦,但我希望我能做到
现在我遇到了一个构建异常:无法处理资源,请参阅上面的aapt输出以了解详细信息
问题似乎是这样的:
error: style attribute '@android:attr/textColor' not found.
Message{kind=ERROR, text=error: style attribute '@android:attr/textColor' not found.,
sources=[/Users/<username>/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/4215c9c9bb2efc5bb086ff343ac44128/res/values/values.xml],
original message=, tool name=Optional.of(AAPT)}
错误:未找到样式属性'@android:attr/textColor'。
消息{kind=ERROR,text=ERROR:未找到样式属性'@android:attr/textColor'。,
sources=[/Users//.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/4215c9c9bb2efc5bb086ff343ac44128/res/values/values.xml],
原始消息=,工具名称=可选。of(AAPT)}
我发现了以下问题和答案,但我相信如果不是在我们自己的项目中,情况会有所不同:
发生这种情况的原因是什么?我该如何解决
规格:
Android Studio 3.1.2
JRE:1.8.0_152-release-1024-b01 x86_64
BuildTools版本:27.0.3
等级:4.6
Gradle插件:3.1.2
编辑:
以防万一,我从我们的项目中删除了每一行样式和属性,并对缓存和重新启动以及所有内容进行了干净的构建和失效,但是构建仍然指向com.android.support:appcompat-v7:27.1.1
的values.xml
,我遇到了同样的问题,发现主要问题是aapt2没有正确报告问题位置
对所有样式xml文件进行全局搜索,查找name=“@android
”。
这是哇哦的一部分。这就是原因。我们有一个
。删除了@
,现在一切都正常了。我可以再次开始使用Instant Run了。非常感谢!:-)疯狂…我被困在这几个小时了!