Android resource compilation failed-duplicate value for resource 'attr/layout_anchorGravity' with config

久未见 提交于 2019-12-25 18:34:06

问题


Android resource compilation failed

Output:

C:\projects\template\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:218: error: duplicate value for resource 'attr/layout_anchorGravity' with config ''. C:\projects\template\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:218: error: resource previously defined here.

Command:

C:\Users\music7.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\b9713b2bbe96f34444d44f2bfbbdc6b8\aapt2-3.2.1-4818971-windows\aapt2.exe compile --legacy \ -o \ C:\projects\template\app\build\intermediates\res\merged\debug \

C:\projects\template\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #1

got this error plz give the solution


回答1:


This error took me forever to debug. But, at the end it all came down to whether you have made use of two "implementation" sources that do similar things. For example if you use a custom seekbar, from two different sources, both the seekbars will change the value of tools:max. This will cause the problem. It is the same reason why even you are getting the same error

error: resource previously defined here

If you have used two different implementation which are similar, remove one of them or comment and check it will be solved



来源:https://stackoverflow.com/questions/53368774/android-resource-compilation-failed-duplicate-value-for-resource-attr-layout-an

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!