HaylLtd / cordova-background-geolocation-plugin

Background and foreground geolocation plugin for Cordova.
Apache License 2.0
57 stars 66 forks source link

created new project for background location #105

Closed kotran88 closed 1 year ago

kotran88 commented 2 years ago

I'm using ionic v3

I just run basic template and add this plugin cordova plugin add cordova-background-geolocation-plugin
and then, error occurs

`

Task :app:compileDebugJavaWithJavac /Users/pedrojung/Downloads/samchully/myApp/platforms/android/app/src/main/java/com/marianhello/bgloc/provider/DistanceFilterLocationProvider.java:88: error: cannot find symbol int zeroFlag = Build.VERSION.SDK_INT >= Build.VERSION_CODES.S ^ symbol: variable S location: class VERSION_CODES /Users/pedrojung/Downloads/samchully/myApp/platforms/android/app/src/main/java/com/marianhello/bgloc/provider/DistanceFilterLocationProvider.java:89: error: cannot find symbol ? 0 | PendingIntent.FLAG_MUTABLE ^ symbol: variable FLAG_MUTABLE location: class PendingIntent /Users/pedrojung/Downloads/samchully/myApp/platforms/android/app/src/main/java/com/marianhello/bgloc/provider/DistanceFilterLocationProvider.java:92: error: cannot find symbol int cancelCurrentFlag = Build.VERSION.SDK_INT >= Build.VERSION_CODES.S ^ symbol: variable S location: class VERSION_CODES /Users/pedrojung/Downloads/samchully/myApp/platforms/android/app/src/main/java/com/marianhello/bgloc/provider/DistanceFilterLocationProvider.java:93: error: cannot find symbol ? PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_MUTABLE ^ symbol: variable FLAG_MUTABLE location: class PendingIntent /Users/pedrojung/Downloads/samchully/myApp/platforms/android/app/src/main/java/com/marianhello/bgloc/sync/NotificationHelper.java:81: error: cannot find symbol int flags = Build.VERSION.SDK_INT >= Build.VERSION_CODES.S ^ symbol: variable S location: class VERSION_CODES`

ionic info is

` Ionic:

Ionic CLI : 5.4.16 (/Users/pedrojung/.nvm/versions/node/v14.17.3/lib/node_modules/ionic) Ionic Framework : ionic-angular 3.9.9 @ionic/app-scripts : 3.2.4

Cordova:

Cordova CLI : 11.0.0 Cordova Platforms : android 10.1.2 Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 5.0.0, (and 4 other plugins)

Utility:

cordova-res : 0.15.4 native-run (update available: 1.6.0) : 1.5.0

System:

ios-deploy : 1.11.4 NodeJS : v14.17.3 (/Users/pedrojung/.nvm/versions/node/v14.17.3/bin/node) npm : 6.14.13 OS : macOS Ventura Xcode : Xcode 13.4.1 Build version 13F100`

HarelM commented 2 years ago

I suggest to use an older version, this is due to changes required for android 12, API 32.

noriellecruz commented 2 years ago

to fix this, you should use the latest cordova-android which can be installed via platforms: cordova platforms add android@latest

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 1 year ago

This issue has been automatically closed, because it has not had recent activity. If you believe this issue shouldn't be closed, please reopen or write down a comment requesting issue reopening with explanation why you think it's important. Thank you for your contributions.