Skip to content
This repository has been archived by the owner on May 9, 2022. It is now read-only.

Conflicting 'com.google.android.gms:play-services-location:' with react-native maps #10

Open
chetnadaffodil opened this issue Dec 12, 2016 · 4 comments

Comments

@chetnadaffodil
Copy link

Hi,
I am trying to use your package along with react-native-maps but the creation of the build is failing
due to conflicting 'com.google.android.gms:play-services-location' in both packages.

Here is a picture of the error thrown
screenshot from 2016-12-12 13-34-29

@chetnadaffodil
Copy link
Author

chetnadaffodil commented Dec 12, 2016

Your build.gradle file

dependencies {
compile 'com.facebook.react:react-native:+'
compile 'com.google.android.gms:play-services-location:8.4.0'
}

React Native Maps build.gradle file
dependencies {
compile 'com.facebook.react:react-native:+'
compile "com.google.android.gms:play-services-base:9.4.0"
compile 'com.google.android.gms:play-services-maps:9.4.0'
}

There is a mismatch of the versions for com.google.android.gms package
Please upgrade it to 9.4.0

@KamWis
Copy link

KamWis commented Dec 28, 2016

@chetnadaffodil I've updated com.google.android.gms to 9.4.0 and added compile 'com.google.android.gms:play-services-places:9.4.0' but it seems somethins still off. There is no conflict anymore but got fallowing error:

image

whole crash log:

297/com.awesomeproject E/unknown:React: Exception in native call
                                                                 java.lang.RuntimeException: Could not invoke RNGooglePlacePicker.show
                                                                     at com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke(BaseJavaModule.java:332)
                                                                     at com.facebook.react.cxxbridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:158)
                                                                     at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
                                                                     at android.os.Handler.handleCallback(Handler.java:751)
                                                                     at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                     at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
                                                                     at android.os.Looper.loop(Looper.java:154)
                                                                     at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196)
                                                                     at java.lang.Thread.run(Thread.java:761)
                                                                  Caused by: java.lang.reflect.InvocationTargetException
                                                                     at java.lang.reflect.Method.invoke(Native Method)
                                                                     at com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke(BaseJavaModule.java:318)
                                                                     at com.facebook.react.cxxbridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:158) 
                                                                     at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) 
                                                                     at android.os.Handler.handleCallback(Handler.java:751) 
                                                                     at android.os.Handler.dispatchMessage(Handler.java:95) 
                                                                     at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31) 
                                                                     at android.os.Looper.loop(Looper.java:154) 
                                                                     at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196) 
                                                                     at java.lang.Thread.run(Thread.java:761) 
                                                                  Caused by: java.lang.NoSuchMethodError: No virtual method zzbo(Landroid/content/Context;)V in class Lcom/google/android/gms/common/GoogleApiAvailability; or its super classes (declaration of 'com.google.android.gms.common.GoogleApiAvailability' appears in /data/app/com.awesomeproject-2/base.apk)
                                                                     at com.google.android.gms.location.places.ui.zza$zza.build(Unknown Source)
                                                                     at com.google.android.gms.location.places.ui.PlacePicker$IntentBuilder.build(Unknown Source)
                                                                     at com.reactlibrary.RNGooglePlacePickerModule.show(RNGooglePlacePickerModule.java:55)
                                                                     at java.lang.reflect.Method.invoke(Native Method) 
                                                                     at com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke(BaseJavaModule.java:318) 
                                                                     at com.facebook.react.cxxbridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:158) 
                                                                     at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) 
                                                                     at android.os.Handler.handleCallback(Handler.java:751) 
                                                                     at android.os.Handler.dispatchMessage(Handler.java:95) 
                                                                     at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31) 
                                                                     at android.os.Looper.loop(Looper.java:154) 
                                                                     at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196) 
                                                                     at java.lang.Thread.run(Thread.java:761) 

@geordasche
Copy link
Contributor

@KamWis @chetnadaffodil
Looks like the play services places library has been moved since the 8.4.0 version referenced in react-native-google-place-picker.

I was able to workaround by forking and updating react-native-google-place-picker's dependency.

See my forked change: geordasche@85abf5c

try npm install github:geordasche/react-native-google-place-picker to see if that works for you.

Hope this helps. Remember to reset your npm cache and clean/sync your build as well.

@zhangtaii
Copy link
Owner

zhangtaii commented Jan 6, 2017

Closed and reopened this issue as it's impossible keep dependencies always be compatible with other libraries.
If there is conflict, please refer to @chetnadaffodil or @geordasche 's comment, modify the build.gradle from either side manually to resolve it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants