Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Program type already present: com.google.android.gms.common.util.VisibleForTesting

Hello I am getting following Error. I searched a lot, But none of the solution worked for me.

Caused by: com.android.builder.multidex.D8MainDexList$MainDexListException: com.android.tools.r8.errors.CompilationError: Program type already present: com.google.android.gms.common.util.VisibleForTesting

My Gradle

dependencies {
    implementation('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
        transitive = true;
    }
    implementation 'com.android.support:multidex:1.0.3'
    implementation files('libs/AdiquityAndroidSDK.jar')
    implementation files('libs/gdx-backend-android.jar')
    implementation files('libs/libGoogleAnalyticsServices.jar')
    implementation files('src/main/jniLibs/gdx.jar')
//    implementation files('src/main/jniLibs/gdx-backend-android.jar')
    implementation 'com.google.android.gms:play-services-ads:15.0.1'
    implementation 'com.facebook.android:facebook-android-sdk:4.33.0'
}

I have also used latest gms plugin.

classpath 'com.google.gms:google-services:4.0.1'

with gradle-wrapper 4.4 and build gradle 3.1.3.

Please Help me How to solve this.

like image 225
Abhay Koradiya Avatar asked Nov 25 '25 11:11

Abhay Koradiya


1 Answers

After Searching a lot, getting Solution.

after remove implementation files('libs/libGoogleAnalyticsServices.jar') issue solved.

The issue was that the file with the same package and file name was present in two different jars one jar was of old google analytics services jar.

We have to resolve this conflict (I had removed my old jar as it was no longer needed) and the project would build.

like image 94
Abhay Koradiya Avatar answered Nov 27 '25 00:11

Abhay Koradiya



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!