0
votes

I am using react-native-background-geolocation package. I am getting an error in gradle file

react-native-mauron85-background-geolocation:compileReleaseJavaWithJavac Full recompilation is required because at least one of the classes of removed jar 'classes.jar' requires it. Analysis took 0.033 secs. /home/ubuntu/code/truck-kothay-apps/truck-driver-app/node_modules/react-native-mauron85-background-geolocation/android/lib/src/main/java/com/marianhello/bgloc/data/BackgroundActivity.java:22: error: cannot access AbstractSafeParcelable confidence = actitivy.getConfidence(); ^ class file for com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable not found Note: /home/ubuntu/code/truck-kothay-apps/truck-driver-app/node_modules/react-native-mauron85-background-geolocation/android/lib/src/main/java/com/marianhello/bgloc/BackgroundGeolocationFacade.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 error :react-native-mauron85-background-geolocation:compileReleaseJavaWithJavac FAILED

FAILURE: Build failed with an exception.
1

1 Answers

0
votes

You need to check MainApplication.java file, check if

new BackgroundGeolocationPackage() is there. After that make these changes in app/build.gradle

compileSdkVersion 25
buildToolsVersion "25.0.2"


compile(project(':react-native-mauron85-background-geolocation')) {
        exclude group: 'com.google.android.gms', module: 'play-services-location'
    }
compile 'com.google.android.gms:play-services-base:+'
compile 'com.google.android.gms:play-services-maps:+'

Rebuild the project after that and see.