androidadmobfacebook-ads

Duplicate class com.google.android.flexbox - Android Admob


I am using admob and facebook for ads in my app and its done but I want to check it so i have added Mediation Test Suite depnedancy

 implementation 'com.google.android.ads:mediation-test-suite:2.0.0'

And the app could not build it shows

Duplicate class com.google.android.flexbox.AlignContent found in modules jetified-flexbox-1.1.1-runtime (com.google.android:flexbox:1.1.1) and jetified-flexbox-3.0.0-runtime (com.google.android.flexbox:flexbox:3.0.0)
Duplicate class com.google.android.flexbox.AlignItems found in modules jetified-flexbox-1.1.1-runtime (com.google.android:flexbox:1.1.1) and jetified-flexbox-3.0.0-runtime (com.google.android.flexbox:flexbox:3.0.0)

And many more Duplicate Class of Flexbox

my admob version

implementation 'com.google.android.gms:play-services-ads:20.4.0'

Solution

  • The package name is wrong.

    com.google.android:flexbox:1.1.1
    

    Here is the correct one. ↓

    implementation ('com.google.android.ads:mediation-test-suite:2.0.0') {
       exclude group: "com.google.android", module: "flexbox"
    }
    

    It worked for me.