Skip to content Skip to sidebar Skip to footer

Attribute "barlength" Has Already Been Defined

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/admin/Documents/workspace

Solution 1:

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.

Solution 2:

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.

Solution 3:

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

Solution 4:

buildToolsVersion 21 targetSdkVersion "22.0.1"

Post a Comment for "Attribute "barlength" Has Already Been Defined"