我长期以来一直在尝试找出问题所在,但不幸的是无法
If I do
android.enableAapt2=true
代码工作正常,但是删除相同的代码(应该是强制的)会抛出错误
\incremental\mergeDevDebugResources\merged.dir\values\values.xml:5887: error: style attribute 'attr/@attr/minTextSize' not found.
这是我正在使用的版本的详细信息
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.jakewharton:butterknife-gradle-plugin:8.4.0'
classpath 'com.google.gms:google-services:4.0.1'
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.6.1"
在 Gradle.Properties 中
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8-all.zip
支持库版本
compile 'com.android.support:appcompat-v7:28.0.0'
错误输出路径
\.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0-alpha3.aar\33e6fcc6d3eea5b57de6d7aedf3f55c0\res\values\values.xml
Well, in my case it happened when i upgraded build tools, to resolve this issue,
you should have two attr files like in this image:
将这些行添加到attr.xml 两者 files:
<style name="SquareTextView">
<item name="minTextSize">5dp</item>
</style>
<declare-styleable name="SquareTextView"><attr format="dimension" name="minTextSize"/></declare-styleable>
这解决了我面临的问题。希望它能帮助某人。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)