Mauron85 background geolocatoin

Hey,

i tried to implement the background geolocation plugin.

The part where iam struggling is when i try to compile the android project i get an weird resource linking error.

Do someone know where this error comes from ? I dont know much about android development and think didnt do something wrong in the setup process.

Android Studio Linking Error:

Android resource linking failed

D:\Amicido\99-Users-l.catania\ion4\android\capacitor-cordova-android-plugins\build\intermediates\packaged_res\debug\xml\authenticator.xml:2: error: resource string/mauron85_bgloc_account_type (aka com.amicido.app:string/mauron85_bgloc_account_type) not found.
D:\Amicido\99-Users-l.catania\ion4\android\capacitor-cordova-android-plugins\build\intermediates\packaged_res\debug\xml\syncadapter.xml:2: error: resource string/mauron85_bgloc_account_type (aka com.amicido.app:string/mauron85_bgloc_account_type) not found.
D:\Amicido\99-Users-l.catania\ion4\android\capacitor-cordova-android-plugins\build\intermediates\packaged_res\debug\xml\syncadapter.xml:2: error: resource string/mauron85_bgloc_content_authority (aka com.amicido.app:string/mauron85_bgloc_content_authority) not found.
error: failed linking file resources.

Here is my package.json as well:

{
  "name": "Amicido",
  "version": "0.0.0",
  "author": "Amicido",
  "homepage": "https://amicido.com/",
  "description": "Amicido",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^7.2.11",
    "@angular/cdk": "^7.3.6",
    "@angular/common": "^7.2.11",
    "@angular/core": "^7.2.11",
    "@angular/forms": "^7.2.11",
    "@angular/http": "^7.2.11",
    "@angular/platform-browser": "^7.2.11",
    "@angular/platform-browser-dynamic": "^7.2.11",
    "@angular/pwa": "^0.12.2",
    "@angular/router": "^7.2.11",
    "@capacitor/android": "^1.0.0-beta.19",
    "@capacitor/cli": "^1.0.0-beta.19",
    "@capacitor/core": "^1.0.0-beta.19",
    "@fortawesome/angular-fontawesome": "^0.3.0",
    "@fortawesome/fontawesome-svg-core": "^1.2.12",
    "@fortawesome/free-brands-svg-icons": "^5.6.3",
    "@fortawesome/free-solid-svg-icons": "^5.6.3",
    "@ionic-native/background-geolocation": "^5.3.0",
    "@ionic-native/core": "^5.3.0",
    "@ionic-native/media-capture": "^5.3.0",
    "@ionic/angular": "4.0.0",
    "@ionic/pwa-elements": "^1.0.2",
    "@ionic/storage": "^2.2.0",
    "@ngx-gallery/core": "^4.0.1",
    "@ngx-gallery/gallerize": "^4.0.1",
    "@ngx-gallery/lightbox": "^4.0.1",
    "@ngx-share/button": "^7.1.2",
    "@ngx-share/buttons": "^7.1.2",
    "@ngx-share/core": "^7.1.2",
    "@ngx-translate/core": "^11.0.1",
    "@ngx-translate/http-loader": "^4.0.0",
    "cordova-plugin-file": "^6.0.1",
    "cordova-plugin-mauron85-background-geolocation": "3.0.1",
    "cordova-plugin-media-capture": "3.0.2",
    "core-js": "^2.5.4",
    "es6-promise-plugin": "^4.2.2",
    "gsap": "^2.1.2",
    "hammerjs": "^2.0.8",
    "ng-lazyload-image": "^5.0.0",
    "ngx-img-fallback": "^1.3.3",
    "ngx-skeleton-loader": "^1.1.2",
    "rxjs": "~6.3.3",
    "snazzy-info-window": "^1.1.1",
    "sweetalert": "^2.1.2",
    "zone.js": "~0.8.26"
  },
  "devDependencies": {
    "@angular-devkit/architect": "~0.11.4",
    "@angular-devkit/build-angular": "^0.13.7",
    "@angular-devkit/core": "^7.3.7",
    "@angular-devkit/schematics": "^7.3.7",
    "@angular/cli": "^7.3.7",
    "@angular/compiler": "^7.2.11",
    "@angular/compiler-cli": "^7.2.11",
    "@angular/language-service": "^7.2.11",
    "@ionic/angular-toolkit": "~1.2.0",
    "@ionic/lab": "1.0.18",
    "@types/greensock": "^1.15.32",
    "@types/jasmine": "^3.3.12",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "^11.12.0",
    "@types/parse": "^2.1.0",
    "codelyzer": "~4.5.0",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "^4.0.1",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.4.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.12.0",
    "typescript": "~3.1.6"
  },
  "engines": {
    "node": "10.13.0"
  },
  "cordova": {
    "plugins": {
      "cordova-plugin-media-capture": {},
      "cordova-plugin-mauron85-background-geolocation": {}
    },
    "platforms": []
  }
}

Thanks in advantage

2 Likes

Hi
I am facing the same issue. Please let me know if you figure out an answer.

Thanks
Ramesh

Same issue. Still not fixed. Need help.

There are some strings missing in your strings.xml file. This occurs because @mauron85/cordova-plugin-background-geolocation is (as its name says) a cordova plugin that have some configuration settings into its plugin.xml file and, as described here, Capacitor does not auto install Cordova variables, hooks, etc. when you sync, so you need to manually map those configuration settings from the plugin’s plugin.xml file to your AndroidManifest.xml file (or Info.plist file in iOS). See more details about about these procedures for android here and iOS here.

To solve this you can insert the following resources into your strings.xml file (you can check the following resources into the plugin’s plugin.xml file):

<string name="mauron85_bgloc_account_name">$ACCOUNT_NAME</string>
<string name="mauron85_bgloc_account_type">$ACCOUNT_TYPE</string>
<string name="mauron85_bgloc_content_authority">$CONTENT_AUTHORITY</string>