Android build fails with duplicate com.facebook.* classes when using mwdat-core in Expo / React Native #25
QuentinGrange
started this conversation in
Help
Replies: 1 comment 8 replies
-
|
Patch mwdat-core AAR to remove bundled Facebook classes (Repackage the AAR) I ran into the same issue integrating mwdat-core into an Expo/React Native app. Since the Facebook classes are physically bundled inside the AAR (not declared as Gradle dependencies), the only solution is to manually strip them out. +1 to the request for Meta to either:
|
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Android build fails with duplicate com.facebook.* classes when using mwdat-core in Expo / React Native
Description
I’m trying to build an Expo module to integrate mwdat into a React Native / Expo app.
Environment
com.meta.wearable:mwdat-core:0.3.0Build error
During the Android build, Gradle fails with duplicate class errors:
Similar duplicate errors occur for many classes under:
com.facebook.common.*com.facebook.jni.*com.facebook.proguard.annotations.*(See full stack trace above.)
Analysis
After investigation, it appears that
mwdat-core-0.3.0.aarbundles Facebook libraries directly inside its AAR, including:com.facebook.common.*)com.facebook.jni.*)These same libraries are already present in React Native / Expo, which causes duplicate classes at build time.
Because these classes are physically embedded in the mwdat-core AAR (not declared as Gradle dependencies), standard Gradle solutions such as:
excluderesolutionStrategy.forcedo not resolve the issue.
Expected behavior
Ideally,
mwdat-coreshould:This would allow mwdat to be used in React Native / Expo Android projects without conflicts.
Questions
Thanks in advance 🙏
Beta Was this translation helpful? Give feedback.
All reactions