Android release build error - classes defined multiple times
See original GitHub issueYour Environment
- Plugin version: 0.6.3
- Platform: Android
- OS version: MacOS 10.14.5
- React Native version: 0.61.5
When I run ./gradlew bundleRelease
, I get this error
Type org.apache.commons.io.Charsets is defined multiple times: /Users/x/Workspace/Web/x/node_modules/@mauron85/react-native-background-
geolocation/android/common/build/.transforms/a8e102993c8c7adae72bf050e6cc7e7e/classes/classes.dex,
/Users/x/Workspace/Web/x/android/app/build/intermediates/external_libs_dex/release/out/classes2.dex
Here is my android/build.grade
file in my react native project
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 21
compileSdkVersion = 28
targetSdkVersion = 28
googlePlayServicesVersion = "17.0.0"
}
repositories {
google()
jcenter()
}
dependencies {
classpath('com.android.tools.build:gradle:3.6.4')
classpath 'com.google.gms:google-services:4.3.3'
}
}
allprojects {
repositories {
mavenLocal()
maven {
url("$rootDir/../node_modules/react-native/android")
}
maven {
url("$rootDir/../node_modules/jsc-android/dist")
}
maven { url 'https://maven.google.com' }
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
I’m able to build the app and the gps is working with yarn react-native android
for local debug building. But the release build is failing using the command above.
How do I resolve this?
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
Type BuildConfig is defined multiple times - Stack Overflow
It's the first time I'm seeing an error like this and I don't know how to fix this and what's even causing it....
Read more >Android Studio generating an error saying “is defined multiple ...
Android Studio generating an error saying “is defined multiple times” ... Just delete the “build” folder of the “app” module.
Read more >Android R8: Type com.swmansion.reanimated.BuildConfig is ...
We are getting Type com.swmansion.reanimated.BuildConfig is defined multiple times when executing the task :app:minifyReleaseWithR8.
Read more >D8 mergeProjectDexDebug fails on AS / AGP 4.2.0-alpha12 ...
The error message given from the build is below. ... Open project in Android Studio 4.2 Canary 12 3. ... DataBindingComponent is defined...
Read more >Gradle tips and recipes - Android Developers
You can use the sourceSets block in the module-level build.gradle file to change ... are only a few examples of the types of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I created fork to solve this issue. https://github.com/darron1217/react-native-background-geolocation
You can install it by command below
@darron1217 your module not build release using androidX. Your module it is Symbol problem.