Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: resource string/plugin_bgloc_content_authority not found #156

Open
diegoarbelaez opened this issue Jul 21, 2023 · 4 comments
Open

Comments

@diegoarbelaez
Copy link

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
Copy link
Collaborator

HarelM commented Jul 21, 2023

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
Copy link
Author

Thanks @HarelM for your reply,

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

Thanks!

@HarelM
Copy link
Collaborator

HarelM commented Jul 21, 2023

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

@hembachrterran
Copy link

hembachrterran commented Aug 10, 2023

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants