background_locator icon indicating copy to clipboard operation
background_locator copied to clipboard

Does someone also face crash issue when running on Android OS 8?

Open function2000 opened this issue 3 years ago • 7 comments

Does someone also face crash issue when running on Android OS 8? I get crash when run on Android OS 8.

function2000 avatar Mar 05 '21 13:03 function2000

Hi @function2000 Thank you for opening an issue;

What kind of issue do you have with Android 8?

mehdok avatar Mar 06 '21 06:03 mehdok

Hi @function2000 Thank you for opening an issue;

What kind of issue do you have with Android 8?

When asked for permission, click allow, then it crashed,and then app cannot be open again. That is the reason I asked if somebody else face the same issue.

function2000 avatar Mar 06 '21 09:03 function2000

Hi @function2000 Thank you for opening an issue;

What kind of issue do you have with Android 8?

Please see below screenshot, maybe you can also have a try on Android 8 device: erro1

error2

function2000 avatar Mar 06 '21 11:03 function2000

@mehdok any solution to make it work on Android 8? Thanks!

function2000 avatar Mar 08 '21 11:03 function2000

@function2000 Please show me some code;

mehdok avatar Mar 21 '21 14:03 mehdok

@function2000 Please show me some code;

Sorry for late reply, here below are some code. I don't think it is my code issue, perhaps you try run on Android 8, you will see the same problem.

================================> void _startLocator() { Map<String, dynamic> data = {'countInit': 1}; BackgroundLocator.registerLocationUpdate(LocationCallbackHandler.callback, initCallback: LocationCallbackHandler.initCallback, initDataCallback: data, /* Comment initDataCallback, so service not set init variable, variable stay with value of last run after unRegisterLocationUpdate */ disposeCallback: LocationCallbackHandler.disposeCallback, iosSettings: IOSSettings( accuracy: LocationAccuracy.NAVIGATION, distanceFilter: 0), autoStop: false, androidSettings: AndroidSettings( accuracy: LocationAccuracy.BALANCED, interval: 60, //1 minute wakeLockTime:1440, //24hours distanceFilter: 0, client: LocationClient.android, androidNotificationSettings: AndroidNotificationSettings( notificationChannelName: 'nxxii_gps_bg', notificationTitle: 'Running in background', notificationMsg: 'Updating...', notificationBigMsg: 'Updating...', notificationIcon: '', notificationIconColor: Colors.grey, notificationTapCallback: LocationCallbackHandler.notificationCallback) )); }

................

void _onStart() async { if (await _checkLocationPermission()) { _startLocator(); final _isRunning = await BackgroundLocator.isServiceRunning();

  setState(() {
    isRunning = _isRunning;
    lastTimeLocation = null;
    lastLocation = null;
  });
} else {
  // show error
}

}

............................................. void initGeoLocator(){

if (IsolateNameServer.lookupPortByName(
    _isolateName) !=
    null) {
  IsolateNameServer.removePortNameMapping(
      _isolateName);
}

IsolateNameServer.registerPortWithName(
    port.sendPort, _isolateName);

port.listen(
      (dynamic data) async {

          lastLocation = data;
          positions.add(data);
      },
);
initGeoPlatformState();
_onStart();

}

function2000 avatar Mar 25 '21 09:03 function2000

android 8.1

@function2000 请给我看一些代码;

android 8.1 I have the same problem,Brand is the oppo

zy693415 avatar Dec 17 '21 01:12 zy693415