Duplicate value fo resource 'attr/tint'

后端 未结 5 2122
滥情空心
滥情空心 2021-02-20 03:05

I do not know how this error started to happen, I simply closed the android studio yesterday and I turned off the pc, today, I turned on the pc and opened the android studio, th

相关标签:
5条回答
  • 2021-02-20 03:40

    Please open show log in files and delete all the files where you located and please restart your android studio.

    if not solved then Again restart with option like InvalidDate Cache and Restart.

    Hope this helps you.

    0 讨论(0)
  • 2021-02-20 03:42

    The solution works for me is to create a new values-v21 folder and put attr.xml in that, by this it would avoid merging your resources and by doing this your attr will work only from sdk 21 and above.

    0 讨论(0)
  • 2021-02-20 03:50

    Android studio creates many files that are not part of the normal source code. If you reboot without saving your project things may get whacked out but this could happen for no apparent reason. You have already cleaned your project so it regenerates some of these files. The .metadata file in the root of your workspace can be deleted but you will need to import all projects already in the workspace. I suggest you check the directory structure of your project using something other than android studio and even delete any generated folders as they will rebuild on the next compile. Perhaps even use a new workspace and copy source code over. First thing you should do is backup everything you want to keep as these suggestions could cause disaster if you are not careful. Consider version control, git repositories or github to save your project in the future as you can roll back to a previous state in the future

    0 讨论(0)
  • 2021-02-20 03:57

    I don't think this is a gradle version issue... I am using Android Studio 3.0 with Gradle Plugin Version 3.0.1 (which uses Gradle 4.1) THE LATEST. And I am getting this same issue. Just rename whatever attribute you've named tint to something like libTint or lib_tint or even more obscure ili_lib_tint so the issue can be resolved. I really want to use this lib and not look else where, please.

    This is the xml element causing the issue

    ImageLetterIcon/imageletter/src/main/res/values/attrs.xml

     <declare-styleable name="TintableImageView">
    
    0 讨论(0)
  • 2021-02-20 04:04

    check dependencies in gradle file.

    2 or more libraries use in project conflict resource file.

    example:

    in library A,B in variables in arrts.xml or color.xml

    0 讨论(0)
提交回复
热议问题