How can I implement Firebase into a detached app?


#1

I am trying to implement Firebase Push Notifications in conjunction with the react-native-push-notification library, into my application but I am unable to add the dependency to build.gradle.

The instructions from react-native-push-notification is to added the following to ALL dependencies added by Expo:

compile project(’:react-native-push-notification’)
compile (‘com.google.android.gms:play-services-gcm:8.1.0’) {
force = true;
}

However, I get the error when I add (only) compile project(’:react-native-push-notification’):

"Execution failed for task ‘:app:transformClassesWithJarMergingForDebug’.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/iid/zzb$zza$zza.class"

This error means that there are two entries for com.google.android.gms

Can you help me identify where this is coming from? I assumed that perhaps it’s being bundled in as part of host.exp.exponent:expoview:21.0.0@aar so I added

exclude group: ‘com.google.android.gms’ - The problem unfortunately still exists.

Here’s my app/build.gradle dependency list (without any modification):

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 'io.intercom.android:intercom-sdk-base:4.+'
compile(‘host.exp.exponent:expoview:21.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.+’)
compile(‘com.facebook.android:audience-network-sdk:4.+’) {
exclude module: ‘play-services-ads’
}
compile(‘io.nlopez.smartlocation:library:3.2.11’) {
transitive = false
}

My questions:

  1. Is the Expo dependency bundling in gms?
  2. If so, how can I remove it? I really need to get this working.

P.S. Sorry for not knowing how to format code snippets

Thanks.


closed #2

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.