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.

Program type already present: com.mapbox.rctmgl.BuildConfig

See original GitHub issue

Describe the bug Hello 😄 I’m trying to build a project that uses react-native-mapbox-gl. Previously I have done all the steps on https://github.com/react-native-mapbox-gl/maps/blob/master/android/install.md. But this error appears on the app build.

* What went wrong:
Execution failed for task ':app:transformClassesWithMultidexlistForDevRelease'.
> com.android.build.api.transform.TransformException: Error while generating the main dex list:
  Error while merging dex archives: 
  Program type already present: com.mapbox.rctmgl.BuildConfig
  Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.

To Reproduce Follow this guide https://github.com/react-native-mapbox-gl/maps/blob/master/android/install.md and set this variable on android/app/build.gradle :

defaultConfig {
    ...
    multiDexEnabled true
}

Expected behavior Build the project correctly

Versions (please complete the following information):

  • Platform: Android
  • Device: no
  • Emulator/ Simulator: no
  • OS: Ubuntu 16
  • react-native-mapbox-gl Version 7.2.0
  • React Native Version 0.61.2

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
mfazekascommented, Apr 23, 2020

@nan140114 do you have anything mapbox related in your gradle?! We need to clean our docs up. With autolinking and 0.60+ you don’t need anything in gradle

0reactions
nan140114commented, Apr 23, 2020

Greetings to both of you. Yes, I followed the guide on the docs to link manually the library on the android app. Following the @mfasekas advice, I removed all the Gradle and Java (MainApplication.java) set up and it worked. Thank you.

Note: I’m going to meet up with the development team to consider using the last release.

Thank you for time again!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Program type already present: com.mapbox.rctmgl.BuildConfig
Describe the bug Hello :D I'm trying to build a project that uses react-native-mapbox-gl. Previously I have done all the steps on ...
Read more >
Program type already present: BuildConfig - android
You are getting this error because you a have library module which has the same package name as the app module.
Read more >
rnmapbox/Lobby - Gitter
Hello all, loving the community on here. I'm trying to use '@rnmapbox/maps' in React Native. Our app is for fishermen recording hauls, it...
Read more >
com.kakeragames.unimgpicker.BuildConfig Error in Unity
My Latest 5 Vlogs on Mr.RK Subscribe Now for more updates:ISKCON Delhi Shree ... Thank you for your time :-) Program type already...
Read more >
native part of mapbox react native libraries were not registered ...
podspec:6: warning: already initialized constant Pod::REACT_NATIVE_MAPBOX_MAPBOX_IOS_VERSION ...ReactNativeNoExpo/node_modules/@react-native-mapbox-gl/maps/ ...
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