• Register
0 votes

Problem :

I am facing the following issue while building my project. I haven't used any CoordinatorLayout in my project. I have just added it as a dependency in my build.gradle :

I am currently using Android Studio 3.2 Canary 4.

My Error as follows :

AGPBI: {"kind":"error","text":"Program type already present: android.support.design.widget.CoordinatorLayout$Behavior","sources":[{}],"tool":"D8"} :app:transformDexArchiveWithExternalLibsDexMergerForDebug FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.

com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: /windows/Other/app/build/intermediates/transforms/dexBuilder/debug/2.jar, /windows/Other/app/build/intermediates/transforms/dexBuilder/debug/6.jar, /windows/Other/app/build/intermediates/transforms/dexBuilder/debug/8.jar, . . ...................


Program type already present: android.support.design.widget.CoordinatorLayout$Behavior

6 5 3
7,540 points

2 Answers

0 votes

Solution :

To resolve your issue please use the following approach:

implementation 'com.android.support:appcompat-v7:27.1.1'

Please Don't do like following :

implementation 'com.android.support:appcompat-v7:27.+'

It may give you the error and so don't use the older version than this.

or even don't do like following :

implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1' 

more numbers of libraries and then

implementation 'com.android.support:appcompat-v7:27.+'

the same library but it has a different version, it may give you an error.

If above approach doesn’t help the follow this one:

Your build script must match with the application build.gradle dependencies as shown below:.

ext {
        buildToolsVersion = "27.0.3"
        minSdkVersion = 16
        compileSdkVersion = 27
        targetSdkVersion = 26
        supportLibVersion = "27.1.1"
dependencies {
    implementation 'com.android.support:support-v4:27.1.0'
    implementation 'com.android.support:design:27.1.0'

if you also want to downgrade your dependencies then also downgrade the supportLibVersion and buildToolsVersion

9 7 4
38,600 points
0 votes


It performed at thr time I downgrade the support appcompat gradle dependency, like follwing :

implementation 'com.android.support:appcompat-v7:27.0.2'

Formerly it was

implementation 'com.android.support:appcompat-v7:27.1.0'


Further this can be solved by only including 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'

I faced the similar issue, I included android support design dependencies to the app level build.gradle

Include following:

implementation 'com.android.support:design:27.1.0'

in build.gradle. Now its performing for me.

It might be reason of a library, I faced it cause of Glide.

It was

implementation 'com.github.bumptech.glide:glide:4.7.1'

So I included exclude group: "com.android.support" And it becomes

implementation ('com.github.bumptech.glide:glide:4.7.1') {
        exclude group: "com.android.support"

Ensure that these two are the same version in your app level build.gradle file

 implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'

Personally, I include the following line to my app/build.gradle:

implementation "com.android.support:design:${rootProject.ext.supportLibVersion}"

I am employing 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.

include Following in gradle implementation 'com.android.support:design:27.1.1'


implementation 'com.android.support:appcompat-v7:27.1.1'

Don't usage like

implementation 'com.android.support:appcompat-v7:27.+'

It may give you an error and don't usage an older version than this.

or event don't do 

implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1' 

 numbers of libraries and then

implementation 'com.android.support:appcompat-v7:27.+'

the similar library however it has a different version, it can give you an error.

10 6 4
31,120 points

Related questions

0 votes
1 answer 1.3K views
Problem : I am learning Android Studio. I am trying to add implemntation 'com.google.android.material:material:1.0.0-alpha1' but if I try to build the project then my Android Studio gives below error: Program type already present: android.support.v4.app. ... .support.v4.app.INotificationSideChannel$Stub$Proxy, sources=[Unknown source file], tool name=Optional.of(D8)} How can I fix the above error?
asked Feb 19 mphil 2.3k points
0 votes
1 answer 41 views
Problem : I am trying to dynamically add and remove the tab in my tablayout. I have already used the FragmentPagerAdapter. I have my TabLayout and inside the TabLayout I have the ViewPager.I am able to add my tabs dynamically but while trying to remove my tab the viewpagers ... deleted and tab is also deleted. As a result my tab is unable to show the specific fragment. How can I fix this issue?
asked Feb 13 mphil 2.3k points
0 votes
1 answer 18 views
Problem: I have the latest version of android studio (3.0) along with the latest build tools (27) and also have the similar API level. But my layout does not get rendered in my design tab and because of this it is causing the lot of trouble especially while ... workable fix for the above problem. I have already spent more than three days on this issue. Is there any work around for this problem?
asked Jul 28 Raphael Pacheco 4.9k points
0 votes
1 answer 594 views
Problem : I have got the following gradle FAILURE message: ..."Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0." My Case description as follows: · I had attached to the project codebase the next libs: APP/build. ... test and got the FAILURE message as follows. Deprecated gradle features were used in this build, making it incompatible with gradle 5.0.
asked Nov 21, 2019 peterlaw 6.9k points
1 vote
1 answer 212 views
Problem : After changing compileSdkVersion 23 and targetSdkVersion 23 I am getting an error error: resource android:style/textappearance.material.widget.button.borderless.colored not found.
asked Nov 11, 2019 peterlaw 6.9k points