Attribute “barLength” has already been defined

前端 未结 4 1057
盖世英雄少女心
盖世英雄少女心 2021-01-17 12:20

I have just updated Material Design Support Lib to v23.0.1 and now, my code doesn\'t compile anymore.

Attribute \"barLength\" has already been defined
/Users         


        
相关标签:
4条回答
  • 2021-01-17 12:36

    Make sure you update your libraries that use the support library to use the same version as the project's support library

    0 讨论(0)
  • 2021-01-17 12:46

    The android:TextAppearance.Material.Widget.Button.Inverse and android:Widget.Material.Button.Colored error is due to you are still using Android Lollipop (API 21) compiler. Change your compileSdkVersion to 23.

    Attribute "barLength" has already been defined error is due to your Gradle version is outdated. Go to Preference -> Build, Execution, Deployment -> Build Tools -> Gradle, change Gradle home to the latest Gradle version (Mine is gradle-2.4)

    Remember to change your project build.gradle to use the following:

    dependencies {
        classpath 'com.android.tools.build:gradle:1.4.0'
    }
    

    And also change your buildToolsVersion to 22.0.1.

    Edit:

    I noticed that you're using ProgressWheel library, created by Todd Davies. There is a conflict of declare-styleable, i.e. the barLength dimension. In that case you'll need to import Progress Wheel as a module in Android Studio and change the name of the attribute.

    0 讨论(0)
  • 2021-01-17 12:47

    buildToolsVersion 21 targetSdkVersion "22.0.1"

    0 讨论(0)
  • 2021-01-17 12:51

    Make sure you do not have any attribute named "barLength". In my case a custom ProgressWheel caused the issue, renamed attr name and problem resolved.

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