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

MissingPluginException(No implementation found for method ready on channel com.transistorsoft/flutter_background_ge #76

Closed
vikramkapoor opened this issue Jun 9, 2019 · 4 comments

Comments

@vikramkapoor
Copy link

vikramkapoor commented Jun 9, 2019

Your Environment

  • Plugin version: flutter_background_geolocation: '^1.0.8'
  • Platform: Android
  • OS version: Android P (9.0)
  • Device manufacturer / model: Android Virtual Device - Nexus 5X API 28 x86
  • Flutter info (flutter doctor):
    Doctor summary (to see all details, run flutter doctor -v):
    [√] Flutter (Channel stable, v1.5.4-hotfix.2, on Microsoft Windows [Version 10.0.18362.113], locale en-US)

[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[√] Android Studio (version 3.4)
[√] VS Code (version 1.35.0)
[√] Connected device (1 available)
• No issues found!

  • Plugin config:
PASTE_YOUR_CODE_HERE
      bg.BackgroundGeolocation.ready(bg.Config(
          desiredAccuracy: bg.Config.DESIRED_ACCURACY_HIGH,
          distanceFilter: 10.0,
          stopOnTerminate: false,
          startOnBoot: true,
          debug: true,
          logLevel: bg.Config.LOG_LEVEL_VERBOSE,
          reset: true))
          .then((bg.State state) {
        if (!state.enabled) {
          ////
          // 3.  Start the plugin.
          //
          bg.BackgroundGeolocation.start();
        }
      });

      // Manually fetch the current position.

      bg.BackgroundGeolocation.getCurrentPosition(
          persist: false, // <-- do not persist this location

          desiredAccuracy: 0, // <-- desire best possible accuracy

          timeout: 30000, // <-- wait 30s before giving up.

          samples: 3 // <-- sample 3 location before selecting best.

      )
          .then((bg.Location location) {
        //_location = location;
        print('[getCurrentPosition] - $location');
        print("Lat: ${location.coords.latitude} Long: ${location.coords
            .longitude}");

Expected Behavior

The call should return location like it does on iOS

Actual Behavior

Leads to MissingPluginException.

Steps to Reproduce

  1. Run the code above from background isolate

Context

Above code works from UI isolate but I need to get location in background. I spawned an isolate and copied the code above to it. It worked on iOS but on Android I get Missing Plugin Exception on bg.BackgroundGeolocation.ready

Debug logs

Logs
PASTE_YOUR_LOGS_HERE
I/flutter ( 7121): Another exception was thrown: MissingPluginException(No implementation found for method listen on channel com.transistorsoft/flutter_background_geolocation/events/location)
I/flutter ( 7121): Another exception was thrown: MissingPluginException(No implementation found for method listen on channel com.transistorsoft/flutter_background_geolocation/events/motionchange)
I/flutter ( 7121): Another exception was thrown: MissingPluginException(No implementation found for method listen on channel com.transistorsoft/flutter_background_geolocation/events/providerchange)
I/flutter ( 7121): Another exception was thrown: MissingPluginException(No implementation found for method listen on channel plugins.pauldemarco.com/flutter_blue/state)
I/flutter ( 7121): [BackgroundGeolocation registerHeadlessTask] ‼️ MissingPluginException(No implementation found for method registerHeadlessTask on channel com.transistorsoft/flutter_background_geolocation/methods)
Error -32601 received from application: Method not found
</details>

@christocracy
Copy link
Member

The issue template is not optional..

You have neglected crucial info. Particularly Plugin version. Edit you issue and provide the Required info.

@vikramkapoor vikramkapoor changed the title MissingPluginException(No implementation found for method getCurrentPosition on channel com.transistorsoft/flutter_background_ge MissingPluginException(No implementation found for method ready on channel com.transistorsoft/flutter_background_ge Jun 9, 2019
@vikramkapoor
Copy link
Author

I found the issue. There was an error during plugin registration for the background Isolate. The problem went away after fixing that.

@christocracy
Copy link
Member

In the future, never ignore the issue template.

@stijnie2210
Copy link

@vikramkapoor Any chance you can tell me how you solved this?

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