Roy*_*erg 4 android android-appcompat android-styles android-gradle-plugin
我正在尝试摆脱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)}
Run Code Online (Sandbox Code Playgroud)
我找到了以下问题和答案,但是我相信它不在我们自己的项目中时会有所不同:无法完成Gradle Build,链接引用失败
发生这种情况的原因是什么,我该如何解决?
规格:
Android Studio 3.1.2
JRE:1.8.0_152-release-1024-b01 x86_64
buildTools版本:27.0.3
Gradle:4.6
Gradle插件:3.1.2
编辑:
万一我删除从我们的项目样式和属性的每一行,做一个干净的构建和缓存和重新启动,一切都无效,但在构建仍然指向其手指values.xml的com.android.support:appcompat-v7:27.1.1。
我遇到了同样的问题,发现主要问题是aapt2没有正确报告问题位置。
对的所有样式xml文件进行全局搜索name="@android。这是<item name="@android:...
您需要删除@字符。
我在其中一个文件中找到了这一行: <item name="@android:textColor">#FF000000</item>
aapt2正确报告了发现@字符的其他位置的问题,但是由于某种原因,在这种情况下它未正确报告。
您可能需要搜索共享文件,甚至需要搜索库aar文件。
| 归档时间: |
|
| 查看次数: |
1756 次 |
| 最近记录: |