Duplicate class a.a found in modules jetified android
Asked Answered
L

2

5

I am using two libraries in my app 1 aar and another gradle dependency. I am getting this error on building release build

Duplicate class a.a found in modules jetified-android-sdk-1.7.26-runtime (com.cashfree.pg:android-sdk:1.7.26) and jetified-adsdk-AN-1.15.16-runtime (adsdk-AN-1.15.16.aar)

This is my build gradle app level

implementation 'com.cashfree.pg:android-sdk:1.7.26'
implementation files('libs/adsdk-AN-1.15.16.aar')

//Dependencies used by all payment modes
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.android.volley:volley:1.1.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'

Not able to understand this a.a class

Lithuanian answered 21/7, 2022 at 14:49 Comment(0)
L
7

The issue was due to proguard rules of the SDK Add below rules to SDK proguard and it worked then

-repackageclasses 'com.example'
-allowaccessmodification
-useuniqueclassmembernames
-keeppackagenames doNotKeepAThing
Lithuanian answered 22/7, 2022 at 7:30 Comment(0)
C
2

It seems that you've got a couple of classes with the same name when obfuscation is done.

a.a is an obfuscated name, you can find how it works and how to extract the mapping file for the obfuscated classes here. You can determine the package name from the mapping file (it will be like a.a -> some.package.name) and exclude it if the next step won't help you.

Check properties in your gradle.properties file, it should be like that.

android.useAndroidX=true
android.enableJetifier=true

If it is - then you'll have to explicitly exclude these classes. You can take a look at this answer.

Christian answered 21/7, 2022 at 15:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.