HaylLtd / cordova-background-geolocation-plugin

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

error: resource string/plugin_bgloc_content_authority not found #156

Open diegoarbelaez opened 1 year ago

diegoarbelaez commented 1 year ago

Compilation for Android is failing "error: resource string/plugin_bgloc_content_authority not found"

I use capacitor 4, and followed the instructions as:

  1. npm install cordova-background-geolocation-plugin
  2. Created a service as this: (and in the app called the service and started to track)

import { Injectable } from '@angular/core'; import { BackgroundGeolocationPlugin, Location, } from 'cordova-background-geolocation-plugin'; declare let BackgroundGeolocation: BackgroundGeolocationPlugin;

@Injectable({ providedIn: 'root', }) export class BackgroundService {

constructor() {}

startBackgroundGeolocation() { BackgroundGeolocation.configure({ locationProvider: BackgroundGeolocation.ACTIVITY_PROVIDER, desiredAccuracy: BackgroundGeolocation.HIGH_ACCURACY, stationaryRadius: 50, distanceFilter: 50, notificationTitle: 'Background tracking', notificationText: 'enabled', debug: true, interval: 10000, fastestInterval: 5000, activitiesInterval: 10000, url: 'http://https://csi.mipgenlinea.com/test/recibirBackground.php', httpHeaders: { 'X-FOO': 'bar', }, // customize post properties postTemplate: { lat: '@latitude', lon: '@longitude', foo: 'bar', // you can also add your own properties }, Captura de Pantalla 2023-07-21 a la(s) 8 56 16 a m

});
BackgroundGeolocation.start();

} }


Please any help or ideas?

I really appreciate

HarelM commented 1 year ago

Sounds like you are missing a string in the app strings table. Here's how I use this plugin: https://github.com/IsraelHikingMap/Site/blob/f5480f43e0f03c104b1fbbffbdcbfe5fa0e74c68/IsraelHiking.Web/src/application/services/geo-location.service.ts

diegoarbelaez commented 1 year ago

Thanks @HarelM for your reply,

However I'm still confused, where are the app strings table?

Thanks!

HarelM commented 1 year ago

In the android configuration files, look in the android folder.

hembachrterran commented 1 year ago

Add these variables inside android/app/src/main/res/values/strings.xml:

<string name="plugin_bgloc_account_name">$ACCOUNT_NAME</string>
<string name="plugin_bgloc_account_type">$ACCOUNT_TYPE</string>
<string name="plugin_bgloc_content_authority">$CONTENT_AUTHORITY</string>