Ionic Background Location Tracking

Hello Everyone,

I added background tracking plugin which given in ionic framework website. but after i added plugin it throws some error . Foreground Tracking Geolocation working fine…problem in background tracking only.

Error:(132, 41) error: cannot find symbol variable SERIAL
/home/user/Ionic/locationApp/platforms/android/app/src/main/java/org/apache/cordova/splashscreen/SplashScreen.java
Error:(297, 87) error: cannot find symbol variable MATCH_PARENT
Error:(297, 114) error: cannot find symbol variable MATCH_PARENT
Error:(371, 87) error: cannot find symbol variable LOLLIPOP
Error:(388, 36) error: cannot find symbol method setIndeterminateTintList(ColorStateList)

/home/user/Ionic/locationApp/platforms/android/app/src/main/java/org/apache/cordova/file/LocalFilesystem.java
Error:(422, 57) error: cannot find symbol variable LOLLIPOP
Error:(424, 34) error: cannot find symbol method getExternalMediaDirs()

/home/user/Ionic/locationApp/platforms/android/app/src/main/java/com/marianhello/bgloc/data/BackgroundLocation.java
Error:(55, 57) error: cannot find symbol variable JELLY_BEAN_MR1
Error:(56, 44) error: cannot find symbol method getElapsedRealtimeNanos()
Error:(58, 57) error: cannot find symbol variable JELLY_BEAN_MR2
Error:(59, 42) error: cannot find symbol method isFromMockProvider()
Error:(567, 57) error: cannot find symbol variable JELLY_BEAN_MR1
Error:(568, 14) error: cannot find symbol method setElapsedRealtimeNanos(long)
Error:(592, 57) error: cannot find symbol variable JELLY_BEAN_MR1

/home/user/Ionic/locationApp/platforms/android/app/src/main/java/com/tenforwardconsulting/bgloc/DistanceFilterLocationProvider.java
Error:(148, 21) error: cannot find symbol method setHorizontalAccuracy(Integer)
Error:(166, 52) error: cannot find symbol variable PASSIVE_PROVIDER
Error:(187, 36) error: cannot find symbol variable ACCURACY_LOW
Error:(190, 36) error: cannot find symbol variable ACCURACY_MEDIUM
Error:(193, 36) error: cannot find symbol variable ACCURACY_HIGH
Error:(196, 36) error: cannot find symbol variable ACCURACY_HIGH
Error:(199, 36) error: cannot find symbol variable ACCURACY_MEDIUM
Error:(463, 53) error: cannot find symbol variable ACCURACY_HIGH
Error:(467, 33) error: cannot find symbol method requestSingleUpdate(Criteria,PendingIntent)

/home/user/Ionic/locationApp/platforms/android/app/src/main/java/com/marianhello/bgloc/data/sqlite/SQLiteOpenHelper.java
Error:(118, 42) error: cannot find symbol method getDatabaseName()
Error:(172, 5) error: method does not override or implement a method from a supertype

Error:Execution failed for task ‘:app:compileDebugJavaWithJavac’.

Compilation failed; see the compiler error output for details.
Information:BUILD FAILED in 2s
Information:55 errors

Try the fix here https://github.com/mauron85/cordova-plugin-background-geolocation/issues/362

Edit the build.gradle
platform/android/app/build.gradle

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_6
targetCompatibility JavaVersion.VERSION_1_6
}

1 Like

Thank a lot very much @cedrickd… Build Successful … Once again thanks so much