question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Type com.bugsnag.android.InternalHooks is defined multiple times

See original GitHub issue

_NOTE: I also posted this over here: https://github.com/bugsnag/bugsnag-android/issues/1387._

Describe the bug

Trying to build a release .apk and getting the error:

* What went wrong:
Execution failed for task ':app:mergeDexRelease'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.DexMergingTaskDelegate
   > There was a failure while executing work items
      > A failure occurred while executing com.android.build.gradle.internal.tasks.DexMergingWorkAction
         > com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: 
           Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
           Type com.bugsnag.android.InternalHooks is defined multiple times: /Users/me/myapp/node_modules/bugsnag-react-native/android/build/.transforms/da03a1461a1d0f0977ec88bf3e613f27/transformed/classes/dex/classes.dex, /Users/me/myapp/android/app/build/intermediates/external_libs_dex/release/mergeExtDexRelease/classes.dex

Steps to reproduce

  1. Using Gradle 7.0.2 and com.bugsnag:bugsnag-android-gradle-plugin:7.1.0.
  2. ./gradlew assembleRelease

Environment

  • Android version: 30
  • Bugsnag version: "@bugsnag/react-native": "7.13.1"
  • Emulator or physical device: n/a

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
xljonescommented, Oct 5, 2021

Thanks for letting us know this is resolved 😀

0reactions
joshuapintercommented, Sep 28, 2021

Yup, I’m an idiot. Sorry. After a botched rebased conflict resolution, we somehow still had the old "bugsnag-react-native" package in our package.json. After removing that and re-running, everything is building fine.

Sorry about that and thanks again for your help! 🙏

Read more comments on GitHub >

github_iconTop Results From Across the Web

Type BuildConfig is defined multiple times - Stack Overflow
I'm using Android Studio 4.0.1 on MacOS. On my network drive within the project app ...
Read more >
Program type already present: com.bugsnag.android ... - GitHub
Expected behavior Build Compilation should be sucessfull Observed behavior Getting Error: > com.android.builder.dexing.
Read more >
Bugsnag docs › Platforms › Android
Learn how to integrate Bugsnag with your Android application for automatic crash reporting and detailed diagnostic reports.
Read more >
Android Studio generating an error saying “is defined multiple ...
Just delete the “build” folder of the “app” module. Afterward, please go to the Build drop-down menu in the menu bar.
Read more >
Bugsnag Android Gradle Plugin - Maven Repository
Version Vulnerabilities Repository Usages Date 7.4.x 7.4.0 Central 1 Nov 10, 2022 7.3.x 7.4.x 7.3.1 Central 1 Oct 05, 2022 7.3.x 7.3.0 Central 0 Jul 27,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found