I am getting the following error while building the project. haven\'t used CoordinatorLayout in this project. just added as a dependency in build.gradle :
I am usin
This can happens when one library is loaded into gradle several times. Most often through other connected libraries.
Remove a implementation this library in build.gradle
Then Build -> Clear project
and you can run the assembly)
It worked when I downgrade the support appcompat
gradle dependency, like follwing :
implementation 'com.android.support:appcompat-v7:27.0.2'
previously it was
implementation 'com.android.support:appcompat-v7:27.1.0'
OR
Also this can be fixed by just adding support design dependency
of version 27.1.0 or above to your app level build.gradle
as following :
implementation 'com.android.support:design:27.1.0'
As android latest update doesn't support 'compile' keyword use 'implementation' in place inside your module build.gradle file.
And check thoroughly in build.gradle for dependancy with + sign like this.
implementation 'com.android.support:support-v4:28.+'
If there are any dependencies like this, just update them with a specific version. After that:
Android support libraries will not be updated after 28.0.0
. According to Support Library Release Notes -
This will be the last feature release under the android.support packaging, and developers are encouraged to migrate to AndroidX 1.0.0.
So use AndroidX support libraries instead. In your case design library is now available in material package.
dependencies {
implementation 'com.google.android.material:material:1.0.0' // instead of design
implementation 'androidx.appcompat:appcompat:1.0.2' // instead of support-v7
}
I have put latest versions in dependency, you can check latest version here at read time.
Useful Posts :
Use the latest supportLibrary
, version 27.1.1
to solve the problem. worked for me. (many bug fixes included - see changelog)
I m using android studio 3.0 and i upgrade the design pattern dependency from 26.0.1 to 27.1.1 and the error is gone now.
Add Following in gradle
implementation 'com.android.support:design:27.1.1'