Skip to content Skip to sidebar Skip to footer

Duplicate Class Android.support.v4.app.notificationcompat$action$extender Found In Modules Classes.jar (com.android.support:support

I'm getting multiple lines of errors saying that it has duplicate class Duplicate class android.support.v4.accessibilityservice.AccessibilityServiceInfoCompat found in modules c

Solution 1:

You need to upgrade the version, you can do this by using the sequence Alt+Enter over the line:

enter image description here

Nowadays you don´t need to use all Google Play Services, just modules, examples:

implementation 'com.google.android.gms:play-services-ads:VERSION'
implementation 'com.google.android.gms:play-services-auth:VERSION'
implementation 'com.google.android.gms:play-services-gcm:VERSION'

but if you really need to use 'com.google.android.gms:play-services:VERSION', to avoid duplicated classes uses this configuration inside your app/build.gradle file:

implementation ('com.google.android.gms:play-services:10.2.4') {
    exclude group: "com.android.support", module: "support-v4"
}

Solution 2:

thanks the above answer by Jorgesys is correct but i migrate to androidx which solved my problem

implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

Solution 3:

// paste this properties in gradle.properties

android.useAndroidX=true

android.enableJetifier=true

  1. First Property will use appropriate androidx libraries instead of using old support libraries.

  2. Second will migrate all third party libraries to androidx libraries.

Post a Comment for "Duplicate Class Android.support.v4.app.notificationcompat$action$extender Found In Modules Classes.jar (com.android.support:support"