Agontuk / react-native-geolocation-service

React native geolocation service for iOS and android
https://www.npmjs.com/package/react-native-geolocation-service
MIT License
1.6k stars 290 forks source link

[TypeError: Cannot read property 'getCurrentPosition' of null] #433

Open iamswarnkar opened 4 months ago

iamswarnkar commented 4 months ago

Environment

Run npx react-native info in your terminal and copy the results here. `$ npx react-native info info Fetching system and libraries information... System: OS: Windows 11 10.0.22000 CPU: (4) x64 Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz Memory: 1.40 GB / 7.92 GB Binaries: Node: version: 20.10.0 path: C:\Program Files\nodejs\node.EXE Yarn: version: 1.22.21 path: ~\AppData\Roaming\npm\yarn.CMD npm: version: 9.2.0 path: C:\Program Files\nodejs\npm.CMD Watchman: Not Found SDKs: Android SDK: API Levels:

`

Platforms

Is this issue related to Android, iOS, or both ?

Android

Versions

Please add the used versions/branches

Description

Please provide a clear and concise description of what the bug is. Include screenshots if needed.

Reproducible Demo

Provide a detailed list of steps that reproduce the issue.

1. 2.

Expected Results

Describe what you expected to happen. image

EmmanuelKeifala commented 4 months ago

I am also facing this issue on version. 5.3.1

neemanwa commented 4 months ago

I'm too facing this issue after updating react-native-maps (https://developers.google.com/maps/documentation/android-sdk/renderer) under that com.google.android.gms:play-services-maps to 18.2.0. And under react-native-geolocation-service def DEFAULT_GOOGLE_PLAY_SERVICES_VERSION = "18.0.0" There is mismatch of play service version and that might be the reason of crash

GunnarAK commented 3 months ago

This is fixed in PR https://github.com/Agontuk/react-native-geolocation-service/pull/399

phaniankur commented 1 month ago

So what is the work around here? Because PR https://github.com/Agontuk/react-native-geolocation-service/pull/399 is not yet merged and released.

  "react": "18.2.0",
  "react-native": "0.74.1",
  "react-native-geolocation-service": "5.3.1"

Recently updated to the latest react-native version and finding this error when location is accepted.

image
xXDeathAbyssXx commented 2 weeks ago

So what is the work around here? Because PR #399 is not yet merged and released.

"react": "18.2.0",
"react-native": "0.74.1",
"react-native-geolocation-service": "5.3.1"

Recently updated to the latest react-native version and finding this error when location is accepted. image

+1

Kishan0904 commented 1 week ago

So what is the work around here? Because PR #399 is not yet merged and released.

"react": "18.2.0",
"react-native": "0.74.1",
"react-native-geolocation-service": "5.3.1"

Recently updated to the latest react-native version and finding this error when location is accepted. image

+1

Add below lines in android/build.gradle

buildscript { ext { // ..... playServicesLocationVersion = "21.0.1" // add this // ..... } }