-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
App crashes or could not invoke Geolocation.getCurrentPosition #398
Comments
Any solution ? |
This is occurring for me with 22.50.14 of google play services as well. |
Any solution? |
@mohdzaifquraishi-greenapex @curtisgibeaut @bicanezin Try putting this in the ext block of android/build.gradle.
|
Hello, this solution doesn't work in case if you have other libraries with An exemple :
In my case this error is still present :
So, still the same question: any idea ? 🙏 |
@LinaEfer |
@bicanezin Unfortunately in my case full clean up (node_modules + yarn.lock, pods, android sync prject & gradle files) doesn't fix the issue :(
|
Locking a particular googlePlayServicesVersion, is a best practices? |
Possible solution: check my response to BTW, documentation for the library literally says lock to version 17: |
Thanks for the info @vsheyanov I'll check from my side and share info here |
@SulthanYS I updated my answer with a command |
You might want to try modifying the build.gradle file of react-native-geolocation-service directly. Change this line:
to:
However, I haven't actually tested this myself as I am not using react-native-device-info. |
Any solution for this issue? |
So far @riku99's workaround is the way to go, I can confirm it's working with React Native 72 and latest version of |
The solutions here didn't quite work for me, but the one here did. It's extremely similar, except in android/gradle.build I set |
Certainly! If you are using React Native version 0.71 and need to update the Google Play Services location dependency, follow these steps:
dependencies {
}
buildscript { |
Thanks @riku99 it solves the issue 🙏🏽 |
a solution for this is . go to file node_modules\react-native-geolocation-service\android\build.gradle and change the this line
and all like this
and patch the package with yarn patch-package react-native-geolocation-service and your issue will be gone |
It fixed my crash. Thanks! |
As @kimthompson indicated, updating buildscript {
ext {
// .....
playServicesLocationVersion = "21.0.1" // add this
// .....
}
} |
remove the react-native-geolocation-service and install npm install react-native-fused-location, this lib works. |
@Bilal-Abdeen it's work, thx! |
@AftabUfaq Thank you brother |
Environment
System:
OS: macOS 12.2.1
CPU: (4) x64 Intel(R) Core(TM) i5-5350U CPU @ 1.80GHz
Memory: 29.25 MB / 8.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.13.1 - /usr/local/bin/node
Yarn: 1.22.19 - ~/****/node_modules/.bin/yarn
npm: 8.1.2 - /usr/local/bin/npm
Watchman: 2022.08.29.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.11.3 - /usr/local/bin/pod
SDKs:
iOS SDK: Not Found
Android SDK:
Android NDK: 22.1.7171670
IDEs:
Android Studio: 2022.1 AI-221.6008.13.2211.9477386
Xcode: /undefined - /usr/bin/xcodebuild
Languages:
Java: 11.0.16.1 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.67.0 => 0.67.0
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
Platforms
Android
Versions
Please add the used versions/branches
Description
Caused by: java.lang.IncompatibleClassChangeError: Found interface com.google.android.gms.location.FusedLocationProviderClient, but class was expected (declaration of 'com.google.android.gms.location.FusedLocationProviderClient' appears in /data/app/~~bD1cPSXr3jYigB864Ni0yw==/com.truecharger-IyI3jbMZVzNj2aO7gf6B4g==/base.apk!classes14.dex)
at com.agontuk.RNFusedLocation.FusedLocationProvider.getCurrentLocation(FusedLocationProvider.java:97)
at com.agontuk.RNFusedLocation.RNFusedLocationModule.getCurrentPosition(RNFusedLocationModule.java:112)
Reproducible Demo
implementation 'com.google.android.gms:play-services-location:21.0.1' implementation (project(path: ':react-native-geolocation-service')) { exclude group: 'com.google.android.gms', module: 'play-services-location' }
Expected Results
getCurrentLocation should return values
Note:
similar to #367
The text was updated successfully, but these errors were encountered: