transistorsoft / cordova-background-geolocation-lt

The most sophisticated background location-tracking & geofencing module with battery-conscious motion-detection intelligence for iOS and Android.
http://www.transistorsoft.com/shop/products/cordova-background-geolocation
Other
655 stars 277 forks source link

AAPT: error: resource android:attr/lStar not found in Android #1356

Closed narenderreddych closed 1 year ago

narenderreddych commented 1 year ago

Your Environment

Expected Behavior

should run the code and give the apk

Actual Behavior

Getting error AAPT: error: resource android:attr/lStar not found in Android I got the following after installing your plugin: AAPT: error: resource android:attr/lStar not found.

Several alternatives, such as removing the diagnostics plugin or removing and re-adding the platform, did not work

Currently I am using Cordova 9.1 for Android

Steps to Reproduce

  1. cordova plugin add cordova-background-geolocation-lt
  2. cordova prepare
  3. cordova compile
  4. AAPT: error: resource android:attr/lStar not found.

Context

Debug logs

Logs ``` PASTE_YOUR_LOGS_HERE ```
christocracy commented 1 year ago

Currently I am using Cordova 9.1 for Android

  1. You need to use latest.
$ cordova -v
11.0.0

$ cordova platform
Installed platforms:
  android 10.1.2
  ios 6.2.0
  1. You need to use compileSdkVersion 31

Here's how I use compileSdkVersion 31 in the SampleApp.

  1. config.xml
  2. create file src/android/build-extras.gradle

You only need this one line:

ext.cdvSdkVersion="31"
narenderreddych commented 1 year ago

it does not support cordova android@9.1.0?

android 10.1.2 having issues in build-tools so am unable to upgrade it I am using Cordova/javascript

christocracy commented 1 year ago

it does not support cordova android@9.1.0?

I doubt it.

android 10.1.2 having issues in build-tools

Likely because you're not using compileSdkVersion 31

You need to upgrade to latest cordova/cordova-android.

narenderreddych commented 1 year ago

Thanks! After removing the plugins you suggested, I successfully installed this plugin

My requirement is to get location details about the app while it's in the background. Here, events are firing and notifications are being received, but the app isn't live

I've added a geofence with exit notification but have not been prompted when leaving the geofence.

Please help me understand how to use cordova-background-geolocation-lt plugin correctly to get location details and to know foreground and background status

I am currently working on a project that requires this scenario. After we see the results we expected, we will purchase a license.

Thank you in advance.

note: still am working on Android platform.

christocracy commented 1 year ago

I've added a geofence with exit notification but have not been prompted when leaving the geofence.

On a real device or emulator? Geofences hardly ever fire in the emulator.

BackgroundGeolocation.onGeofence((event) => {
  console.log('[onGeofence] ', event);
});

const state = await BackgroundGeolocation.ready({
  debug: true,
  BackgroundGeolocation.LOG_LEVEL_VERBOSE,
  stopOnTerminate: false,
  locationAuthorizationRequest: 'Always'
});

const location = await BackgroundGeolocation.getCurrentPosition();

BackgroundGeolocation.addGeofence({
  latitude: location.coords.latitude,
  longitude: location.coords.longitude,
  radius: 200,
  identifier: 'HOME',
  notifyOnEntry: true,
  notifyOnExit: true  
});