Bug report
When using @clerk/expo@3.1.6 alongside react-native-google-mobile-ads@15.8.3, the Android build fails with duplicate class errors.
What happens
clerk-android-ui:1.0.10 transitively depends on com.google.android.libraries.ads.mobile.sdk:ads-mobile-sdk:0.21.0-beta01. This package contains the same classes as com.google.android.gms:play-services-ads-api:24.6.0 (which comes from react-native-google-mobile-ads).
Gradle catches this during checkReleaseDuplicateClasses and kills the build.
Error
Duplicate class com.google.android.gms.ads.AdError found in modules
ads-mobile-sdk-0.21.0-beta01.aar (com.google.android.libraries.ads.mobile.sdk:ads-mobile-sdk:0.21.0-beta01)
play-services-ads-api-24.6.0.aar (com.google.android.gms:play-services-ads-api:24.6.0)
(Same for ~50 other classes in com.google.android.gms.ads.* and com.google.android.gms.ads.mediation.*)
Environment
@clerk/expo: 3.1.6
react-native-google-mobile-ads: 15.8.3
- React Native: 0.81.5
- Expo SDK: 54
- Gradle: 8.14.3
- Build: EAS cloud (production profile)
Workaround
Excluding the transitive dependency via a config plugin works:
configurations.all {
exclude group: 'com.google.android.libraries.ads.mobile.sdk', module: 'ads-mobile-sdk'
}
This keeps play-services-ads-api from the AdMob package and drops the beta ads-mobile-sdk from Clerk. Auth still works fine without it.
Expected behavior
clerk-android-ui shouldn't pull in Google's ads SDK as a transitive dependency. It's unrelated to authentication and creates conflicts for anyone using AdMob.
Ideally, clerk-android-ui should either exclude ads-mobile-sdk from its own dependencies, or pin a version that doesn't conflict with play-services-ads-api.
Bug report
When using
@clerk/expo@3.1.6alongsidereact-native-google-mobile-ads@15.8.3, the Android build fails with duplicate class errors.What happens
clerk-android-ui:1.0.10transitively depends oncom.google.android.libraries.ads.mobile.sdk:ads-mobile-sdk:0.21.0-beta01. This package contains the same classes ascom.google.android.gms:play-services-ads-api:24.6.0(which comes fromreact-native-google-mobile-ads).Gradle catches this during
checkReleaseDuplicateClassesand kills the build.Error
(Same for ~50 other classes in
com.google.android.gms.ads.*andcom.google.android.gms.ads.mediation.*)Environment
@clerk/expo: 3.1.6react-native-google-mobile-ads: 15.8.3Workaround
Excluding the transitive dependency via a config plugin works:
This keeps
play-services-ads-apifrom the AdMob package and drops the betaads-mobile-sdkfrom Clerk. Auth still works fine without it.Expected behavior
clerk-android-uishouldn't pull in Google's ads SDK as a transitive dependency. It's unrelated to authentication and creates conflicts for anyone using AdMob.Ideally,
clerk-android-uishould either excludeads-mobile-sdkfrom its own dependencies, or pin a version that doesn't conflict withplay-services-ads-api.