Unity Duplicate .arr

Thanks — I’m sorry you’re hitting this, Rattanachai. You’ve given a good start. This looks like a duplicate Android library (.aar) / duplicate-class conflict in a Unity Android build (likely when combining MetaMask/Web3Auth libraries with Unity Game Services IAP). I’ll summarize what I see, what I need, and some targeted steps you can try right away.

Summary of what I found

  • Reported platform: Unity (Android build) — duplicate .arr (likely .aar) / duplicate class error when using Unity Game Services IAP
  • Works when you use only Web3Auth (so the conflict is between SDKs/libraries included together)
  • You deleted an old .aar and then the build produced an app that won’t open (suggests a missing dependency or manifest/Gradle merge issue)

What I need if you want deeper help (please only share what you can):

  • Exact Unity version and Android build system (Gradle/Internal). (This matters for resolver behavior.)
  • Exact error text or full Unity Console / Gradle build log (the duplicate-class name and the two .aar paths that contain it). A screenshot of the Unity Console/Editor/Gradle log is fine.
  • A list (or screenshot) of files in Assets/Plugins/Android (the .aar files). That helps identify which libraries provide the duplicate classes.
  • Versions of the SDKs involved: MetaMask SDK (if used), Web3Auth version, Unity Game Services IAP version. If you don’t know exact versions, the filenames of the .aar often contain them.
  • Whether you use External Dependency Manager (a.k.a. Play Services Resolver / EDM4U) and whether you’ve run Resolve/Force Resolve.

Likely cause (short):

  • Two different packages include the same Java class files (duplicate classes inside different .aar files). Deleting a package manually can let the project build but then cause the app to crash at runtime because you removed required code or broke an AndroidManifest/Gradle dependency.

Immediate fixes to try

  1. Don’t manually delete without checking dependency graph: restore the project or the removed .aar so we can inspect conflicts.
  2. Use External Dependency Manager (EDM4U) to resolve Android dependencies instead of manual deletion:
  3. Inspect Assets/Plugins/Android for duplicate .aar files. If two .aar expose the same classes, remove the redundant one ONLY if you confirm it’s not required by another SDK.
  4. Check the Gradle build log (open the Editor log or build output) to find the exact duplicate class name and the two module paths. The error lines look like: Duplicate class com.example.SomeClass found in modules (…)
  5. If the conflict is from commonly-shaded libs (okhttp, guava, org.json, gson), prefer the version required by the SDK you need and exclude the other copy. With custom Gradle templates (mainTemplate.gradle) you can add packagingOptions or exclude rules, but duplicate class errors usually require removing/merging the .aar rather than just excluding files.
  6. If after resolving duplicates the app builds but won’t open, check logcat for runtime exceptions (ClassNotFoundException, NoSuchMethodError, manifest merge problems). Share that log and I can help diagnose.

Helpful links

If you’d like, next steps you can paste here (or attach):

  • The Unity Console/Gradle duplicate-class error text or screenshot (this is the most useful)
  • A folder listing or screenshot of Assets/Plugins/Android (.aar files)
  • Unity version and build system (Gradle/Internal) and the IAP/Web3Auth/MetaMask SDK versions

I’ll keep watching this thread and can propose exact removals or Gradle rules once I see the duplicate-class names and which .aar files contain them. You’re close — these conflicts are common and usually resolved via the Android Resolver or by removing a redundant .aar safely.

Note: This response was generated by an AI bot and may require further verification. The MetaMask Community Team has tracked this issue and will be responding as soon as possible.

Additionally, we would recommend you to join our biweekly Office Hours to get this resolved even faster. MetaMask Developer Office Hours

1 Like

This is all information i gather.

  • Unity 6.3 and 2022.3 both face same issue with Gradle build
  • Screenshot of Console (the duplicate-class)

I don’t know much about how to use Resolver.