获取资源问题重复相关的问题?

时间:2018-06-21 11:16:32

标签: android android-resources

错误消息如下:android 'attr/value' with config ''

这是版本设置:

compileSdkVersion = 27
buildToolsVersion = "27.0.3"
minSdkVersion = 21
targetSdkVersion = 27`

错误消息指定了loading-dots库的名称,该库的资源确实很少,并且不会干扰其他资源。

现在的问题是如何将该错误消息正确解析为一种普通的人类可理解的语言,以便能够找到问题的根源。

什么意思?

 - "attr/value"
 - "with config ''"

这是完整的日志消息

:app:generateDebugResources
AGPBI: {"kind":"error","text":"error: duplicate value for resource \u0027attr/value\u0027 with config \u0027\u0027.","sources":[{"file":"/Users/karate/.gradle/caches/transforms-1/files-1.1/loading-dots-1.0.2.aar/53c3c73936c7c0b67d125304a8d501c0/res/values/values.xml","position":{"startLine":3,"startColumn":4,"startOffset":619,"endColumn":60,"endOffset":675}}],"original":"","tool":"AAPT"}
AGPBI: {"kind":"error","text":"error: resource previously defined here.","sources":[{"file":"/Users/karate/.gradle/caches/transforms-1/files-1.1/loading-dots-1.0.2.aar/53c3c73936c7c0b67d125304a8d501c0/res/values/values.xml","position":{"startLine":3,"startColumn":4,"startOffset":619,"endColumn":60,"endOffset":675}}],"original":"","tool":"AAPT"}


Error: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details
:app:mergeDebugResources FAILED

2 个答案:

答案 0 :(得分:0)

我希望此解决方案对您有所帮助,删除此行buildToolsVersion = "27.0.3"

 compileSdkVersion 27
    defaultConfig {
        applicationId "yourPackageName"
        minSdkVersion 21
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

答案 1 :(得分:0)

该库有问题,它与系统xml属性冲突。这就是为什么您得到错误。此外,您链接到的存储库是向后的,因为它没有values.xml尝试将编译版本更改为较低的数字。也许

compile 'com.eyalbira.loadingdots:loading-dots:1.0.0'