Richou / react-native-android-location-enabler

Display a GoogleMap like android popup to ask for user to enable location services if disabled
MIT License
209 stars 52 forks source link

Java Exception in NativeModules #9

Open meghnakatkamwar opened 6 years ago

meghnakatkamwar commented 6 years ago

I have been getting this error all of a sudden in v1.0.5 Can somebody help me with a solution.

screenshot_20180606-184600

Richou commented 6 years ago

Did you include the play-services-location in your project ?

compile 'com.google.android.gms:play-services-location:7.5.0'

meghnakatkamwar commented 6 years ago

@Richou I tried including play-services-location, it still throws the same error. Any other solution I can try?

Richou commented 6 years ago

Which version did you included ? The version I've pasted is not correct. The version included with the library is 11.0.2 if the version of you project is not the same you can try to exclude it with :

compile project(':react-native-android-location-enabler') {
      exclude group: 'com.google.android.gms', module: 'play-services-places'
}
compile 'com.google.android.gms:play-services-location:11.0.4'

And finally, you can try to launch a build manually in your android directory with :

$ cd android
$ ./gradlew assembleDebug
meghnakatkamwar commented 6 years ago

I tried it with 'com.google.android.gms:play-services-location:11.0.4' , still didn't work for me. what is the google services plugin version to be used? I updated it to 4.0.1 or is there anything else?

Richou commented 6 years ago

Can you try to add the following dependency ?

compile 'com.google.android.gms:play-services-base:11.0.4'

For the google services plugin, the library does not need it.

vinitkadam commented 6 years ago

I was getting the same error. I don't remember why I added google's maven but that was the culprit. Go to android/build.gradle and comment this maven { url 'https://maven.google.com/' name 'Google' } This worked for me.