background_locator_fixed
background_locator_fixed copied to clipboard
[iOS] No implementation found for method LocatorPlugin.isServiceRunning on channel app.yukams/locator_plugin
On iOS when invoking
BackgroundLocator.isServiceRunning()
leads to a MissingPluginException
#0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:313:7)
<asynchronous suspension>
#1 BackgroundLocator.isServiceRunning (package:background_locator_2/background_locator.dart:61:13)
<asynchronous suspension>
#2 BackgroundLocationService.isRunning (package:rebecca_patient_app/src/location/services/background_location.dart:21:29)
<asynchronous suspension>
#3 LocationRepository.backgroundLocationStatus (package:rebecca_patient_app/src/location/repository/location_repository.dart:27:13)
<asynchronous suspension>
#4 new LocationBloc.<anonymous closure> (package:rebecca_patient_app/src/location/bloc/location_bloc.dart:34:61)
<asynchronous suspension>
Seems to be the same issue with #64 that was closed for some reason I don't understand. The iOS implementation of the function seems to exist.
Please advise.
Plugin version: 2.0.6
[!] Flutter (Channel stable, 3.7.9, on macOS 13.0.1 22A400 darwin-arm64, locale en-GR)
• Flutter version 3.7.9 on channel stable at /Users/mug/flutter_3.3.10
! Warning: `dart` on your path resolves to /opt/homebrew/Cellar/dart/2.16.1/libexec/bin/dart, which is not inside your current Flutter SDK checkout at /Users/mug/flutter_3.3.10. Consider adding /Users/mug/flutter_3.3.10/bin to
the front of your path.
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 62bd79521d (6 weeks ago), 2023-03-30 10:59:36 -0700
• Engine revision ec975089ac
• Dart version 2.19.6
• DevTools version 2.20.1
• If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.```
Delete pods,symlink folder and podfile.lock Then In terminal pod update Then pod install
After further examination, it seems that the method works as expected when called from the main isolate (where the plugin has bee initialized).
The error seems to happen only when I try to call the method from the background isolate (the one the plugin spawns). Is it possible that the plugin is not properly initialized in the background isolate? (my callback works fine)
I don't have this problem on Android, which fits this hypothesis, as there is no need for any setup in order to use other plugins in the callback.