链接引用失败 - 在 appcompat 中找不到样式属性“@android:attr/textColor”

Failed linking references - style attribute '@android:attr/textColor' not found in appcompat

我正在尝试从我们的项目中删除即将删除的选项 android.enableAapt2=false。这很痛苦,但我希望我能到达那里。

现在我被BuildException: Failed to process resources, see aapt output above for details卡住了。

问题似乎是这样的:

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 Studio 3.1.2
JRE: 1.8.0_152-release-1024-b01 x86_64
buildToolsVersion: 27.0.3
Gradle: 4.6
Gradle plugin: 3.1.2

编辑:
以防万一我从我们的项目中删除了每一行样式和属性,并进行了干净的构建和缓存失效并重新启动等等,但是构建仍然指向 com.android.support:appcompat-v7:27.1.1values.xml .

我遇到了同样的问题,发现主要问题是aapt2没有正确报告问题位置。

name="@android 的所有样式 xml 文件进行全局搜索。 这是 <item name="@android:...

的一部分

您需要删除@字符。

我在其中一个文件中找到了这一行:<item name="@android:textColor">#FF000000</item>

aapt2 正确报告了它发现 @ 字符的其他位置的问题,但出于某种原因,在这种情况下它没有正确报告。

您可能需要搜索共享文件甚至库 aar 文件(如果有的话)。