Hello,
I am getting a release compilation error after upgrade to latest version of react-native-geolocation-service and react-native to RN0.60.5.
Below is part of the stacktrace
> Task :react-native-geolocation-service:compileReleaseJavaWithJavac FAILED
/Users/chepkeitany/PayGo/hub-agent-app/node_modules/react-native-geolocation-service/android/src/main/java/com/agontuk/RNFusedLocation/LocationUtils.java:10: error: cannot find symbol
import android.support.v4.app.ActivityCompat;
^
symbol: class ActivityCompat
location: package android.support.v4.app
/Users/chepkeitany/PayGo/hub-agent-app/node_modules/react-native-geolocation-service/android/src/main/java/com/agontuk/RNFusedLocation/LocationUtils.java:23: error: cannot find symbol
return ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED ||
^
symbol: variable ActivityCompat
location: class LocationUtils
/Users/chepkeitany/PayGo/hub-agent-app/node_modules/react-native-geolocation-service/android/src/main/java/com/agontuk/RNFusedLocation/LocationUtils.java:24: error: cannot find symbol
ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED;
^
symbol: variable ActivityCompat
location: class LocationUtils
Note: /Users/chepkeitany/PayGo/hub-agent-app/node_modules/react-native-geolocation-service/android/src/main/java/com/agontuk/RNFusedLocation/LocationUtils.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
3 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-geolocation-service:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
I'm getting this issue as well
@smaldd14 Have you resolved your issue?
@Chepkeitany I got the same issue. After some googling, this work for me:
https://github.com/react-native-community/react-native-geolocation/issues/39
Running npx jetify should solve this issue.
I've tried:
rm -rf node_modules/
cd android
./gradlew clean
cd ..
yarn
npx jetify
react-native run-android
But still getting same error :( I'm using RN 0.61.2
Try adding googlePlayServicesVersion = "16.0.0" in your build.gradle's buildscript -> ext block and see if it solves your issue.
Closing due to inactivity
Most helpful comment
Running
npx jetifyshould solve this issue.