Closed adeel399 closed 2 months ago
i have added new issue and follow the template please help me as i already wasted 2 days on that issue please
Plugin version:4.0.1
You’re using a very old version. See the CHANGELOG and update to latest version.
already wasted 2 days on that issue please
Because you’re using an old version from before targetSdkVersion 34 (I presume Google Play Store sent you a warning to update to targetSdkVerion 34). You’re not going to get away with sitting on an old version of this plug-in. You must update to the latest version.
in my package.json i have "cordova-background-geolocation-lt": "^4.0.1", "cordova-plugin-background-fetch": "^7.0.1",
after updating to latest npm install @transistorsoft/capacitor-background-geolocation --save npm install @transistorsoft/capacitor-background-fetch --save
i have added these but older is also there in package.json file should i remove cordova doing that does effect my code
@transistorsoft/capacitor-background-fetch": "^6.0.1", "@transistorsoft/capacitor-background-geolocation": "^6.1.0",
"cordova-background-geolocation-lt": "^4.0.1",
"cordova-plugin-background-fetch": "^7.0.1",
also while updating to latest do i still need to add below code in androidmenifest or that is handled automatically
''' <service android:name=".LocationForegroundService" android:enabled="true" android:exported="false" android:foregroundServiceType="location" /> '''
Remove every plug-in containing the words “background-geolocation” in its name.
Re-install the plugin according to the Installation Steps linked in the readme here.
pretend you’re installing the plugin for the first time ever.
And uninstall every plugin containing the words “background-fetch” as well.
ok i did that the removing part
''' { "name": "unrestricted", "version": "3.3.3", "author": "BB Consulting", "homepage": "https://www.unrestricted.eu/", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e", "postinstall": "patch-package && jetifier" }, "private": true, "dependencies": { "@angular/common": "~13.2.2", "@angular/core": "~13.2.2", "@angular/fire": "^7.3.0", "@angular/forms": "~13.2.2", "@angular/google-maps": "^13.3.3", "@angular/platform-browser": "~13.2.2", "@angular/platform-browser-dynamic": "~13.2.2", "@angular/router": "~13.2.2", "@awesome-cordova-plugins/core": "^5.41.0", "@awesome-cordova-plugins/diagnostic": "^5.41.0", "@awesome-cordova-plugins/facebook": "^5.41.0", "@awesome-cordova-plugins/file": "^5.41.0", "@awesome-cordova-plugins/file-opener": "^6.9.0", "@awesome-cordova-plugins/file-transfer": "^5.41.0", "@awesome-cordova-plugins/geolocation": "^5.41.0", "@awesome-cordova-plugins/screen-orientation": "^5.41.0", "@capacitor-community/apple-sign-in": "^6.0.0", "@capacitor-community/keep-awake": "^5.0.1", "@capacitor/android": "6.0.0", "@capacitor/app": "^6.0.0", "@capacitor/camera": "^6.0.0", "@capacitor/core": "^6.0.0", "@capacitor/device": "^6.0.0", "@capacitor/filesystem": "^6.0.0", "@capacitor/haptics": "^6.0.0", "@capacitor/ios": "6.0.0", "@capacitor/keyboard": "^6.0.0", "@capacitor/network": "^6.0.0", "@capacitor/share": "^6.0.0", "@capacitor/splash-screen": "^6.0.0", "@capacitor/status-bar": "^6.0.0", "@google/maps": "^1.1.3", "@ionic/angular": "^6.0.0", "@transistorsoft/capacitor-background-fetch": "^6.0.1", "@transistorsoft/capacitor-background-geolocation": "^6.1.0", "capacitor-firebase-auth": "^3.0.0", "cordova-plugin-facebook-connect": "^3.2.0", "cordova-plugin-file": "^6.0.2", "cordova-plugin-file-opener2": "^2.2.1", "cordova-plugin-file-transfer": "github:apache/cordova-plugin-file-transfer", "cordova-plugin-geolocation": "^4.1.0", "cordova-plugin-screen-orientation": "^3.0.2", "cordova.plugins.diagnostic": "^6.1.1", "date-fns": "^2.28.0", "easytimer.js": "^4.5.3", "es6-promise-plugin": "^4.2.2", "fast-xml-parser": "3.12.16", "firebase": "^9.6.10", "geolib": "^3.3.3", "google-maps": "^4.3.3", "ngx-image-cropper": "^6.3.2", "ngx-pipes": "^3.0.0", "ngx-skeleton-loader": "^5.0.0", "rxjs": "~6.6.0", "snazzy-info-window": "^1.1.1", "tslib": "^2.2.0", "zone.js": "~0.11.4" }, "devDependencies": { "@angular-devkit/build-angular": "~13.2.3", "@angular-eslint/builder": "~13.0.1", "@angular-eslint/eslint-plugin": "~13.0.1", "@angular-eslint/eslint-plugin-template": "~13.0.1", "@angular-eslint/template-parser": "~13.0.1", "@angular/cli": "^15.1.5", "@angular/compiler": "~13.2.2", "@angular/compiler-cli": "~13.2.2", "@angular/language-service": "~13.2.2", "@capacitor/cli": "6.0.0", "@ionic/angular-toolkit": "^6.0.0", "@types/jasmine": "~3.6.0", "@types/jasminewd2": "~2.0.3", "@types/node": "^12.11.1", "@typescript-eslint/eslint-plugin": "5.3.0", "@typescript-eslint/parser": "5.3.0", "eslint": "^7.6.0", "eslint-plugin-import": "2.22.1", "eslint-plugin-jsdoc": "30.7.6", "eslint-plugin-prefer-arrow": "1.2.2", "jasmine-core": "~3.8.0", "jasmine-spec-reporter": "~5.0.0", "jetifier": "^2.0.0", "karma": "~6.3.2", "karma-chrome-launcher": "~3.1.0", "karma-coverage": "~2.0.3", "karma-coverage-istanbul-reporter": "~3.0.2", "karma-jasmine": "~4.0.0", "karma-jasmine-html-reporter": "^1.5.0", "patch-package": "^6.4.7", "protractor": "~7.0.0", "ts-node": "~8.3.0", "typescript": "~4.4.4" }, "description": "Unrestricted" }
'''
after removing plugin and adding new as u mention this is what i get while building ''' Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Could not find any matches for com.transistorsoft:tsbackgroundfetch:+ as no versions of com.transistorsoft:tsbackgroundfetch are available. Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/transistorsoft/tsbackgroundfetch/maven-metadata.xml
- https://jcenter.bintray.com/com/transistorsoft/tsbackgroundfetch/maven-metadata.xml
- file:/D:/unrestricted-app/android/capacitor-cordova-android-plugins/src/main/libs/
- file:/D:/unrestricted-app/android/app/libs/
- https://repo.maven.apache.org/maven2/com/transistorsoft/tsbackgroundfetch/maven-metadata.xml
- https://developer.huawei.com/repo/com/transistorsoft/tsbackgroundfetch/maven-metadata.xml Required by: project :app > project :transistorsoft-capacitor-background-fetch Could not find any matches for com.transistorsoft:tslocationmanager:+ as no versions of com.transistorsoft:tslocationmanager are available. Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/transistorsoft/tslocationmanager/maven-metadata.xml
- https://jcenter.bintray.com/com/transistorsoft/tslocationmanager/maven-metadata.xml
- file:/D:/unrestricted-app/android/capacitor-cordova-android-plugins/src/main/libs/
- file:/D:/unrestricted-app/android/app/libs/ '''
Like I said, pretend you're installing the plugin for the first time ever. Starting with the Setup Instructions
Just follow the instructions.
thanks alot it worked
Your Environment
Capacitor info: Latest Dependencies:
@capacitor/cli: 6.1.2 @capacitor/core: 6.1.2 @capacitor/android: 6.1.2 @capacitor/ios: 6.1.2
Installed Dependencies:
@capacitor/cli: 6.0.0 @capacitor/core: 6.1.2 @capacitor/android: 6.0.0 @capacitor/ios: 6.0.0
[success] Android looking great! đź‘Ś
Plugin config provided to
#ready
: i dont get what its mean but below is the fuction when on click crash appExpected Behavior
When i try to start recording it should work in the foreground and update my location
Actual Behavior
App crash as i start to run run background location function everything is working fine on android 13 before target api 34 after updating to 34 now app is crash as i clicked
i tried to add all permissions and well as new update for forground service type location but nothing works app still crashing
Steps to Reproduce
just update target api to 34 in variable file and you will see that crash
Context
Debug logs
Logs
``` Caused by: android.app.MissingForegroundServiceTypeException: Starting FGS without a type callerApp=ProcessRecord{a1bfbdf 10435:be.bbconsulting.unrestricted/u0a295} targetSDK=34 ```