react-native-background-geolocation: duplicate entry: com/google/android/gms/auth/api/signin/zzc.class
Your Environment
- Plugin version: 2.9.4
- Platform: Android
- OS version: Android 8.0
- Device manufacturer / model: Pixel Simulator
- React Native version (
react-native -v): 0.49.3 - Plugin config
- Expo Version: 22.0.0
Expected Behavior
Link library to android ap and run.
Actual Behavior
Unable to run app due to duplicate dependencies.
Steps to Reproduce
- Detach working expo app
- Tested Android app before linking library
- Link Library base on https://github.com/transistorsoft/react-native-background-geolocation/blob/master/docs/INSTALL-ANDROID-RNPM.md .
- Run from Android Studios
Context
I have been reviewing posts like the following hoping to make sense of the error.
https://github.com/transistorsoft/react-native-background-geolocation/issues/244 https://github.com/transistorsoft/react-native-background-geolocation/issues/229
Debug logs
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/auth/api/signin/zzc.class
Build.Gradle File
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
defaultConfig {
applicationId "com.thirtyEigthSS.FCEChauffeur"
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
ndk {
abiFilters 'armeabi-v7a', 'x86'
}
manifestPlaceholders = [
'appAuthRedirectScheme': 'com.thirtyEigthSS.FCEChauffeur'
]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
javaMaxHeapSize "8g"
}
lintOptions {
abortOnError false
}
}
task exponentPrebuildStep(type: Exec) {
workingDir '../../'
if (System.getProperty('os.name').toLowerCase().contains('windows')) {
commandLine 'cmd', '/c', '.\\.expo-source\\android\\detach-scripts\\prepare-detached-build.bat'
} else {
commandLine './.expo-source/android/detach-scripts/prepare-detached-build.sh'
}
}
preBuild.dependsOn exponentPrebuildStep
repositories{
flatDir{
dirs 'libs'
}
mavenLocal()
maven { url 'https://maven.fabric.io/public' }
}
repositories {
flatDir {
dirs "../../node_modules/react-native-background-geolocation/android/libs"
}
}
dependencies {
compile project(':react-native-background-geolocation')
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:multidex:1.0.1'
compile('host.exp.exponent:expoview:22.0.0@aar') {
exclude group: 'com.facebook.android', module: 'facebook-android-sdk'
exclude group: 'com.facebook.android', module: 'audience-network-sdk'
exclude group: 'io.nlopez.smartlocation', module: 'library'
transitive = true;
}
compile ('com.facebook.android:facebook-android-sdk:4.+') {
exclude module: 'bolts-android'
}
compile('com.facebook.android:audience-network-sdk:4.+') {
exclude module: 'play-services-ads'
}
compile('io.nlopez.smartlocation:library:3.2.11') {
transitive = false
}
compile(name: 'tslocationmanager', ext: 'aar')
}
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 20 (9 by maintainers)
With latest version coming soon, you’ll need to use minimum
11.2.0.Latest
play-servicesversion (released Nov 6) is11.6.0. It’s always preferable to use latest version.Wanted to post my working build.gradle file. See all lines with ‘//Added this’