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

Unhandled Exception: MissingPluginException(No implementation found #169

Closed
MahmmoudSabri opened this issue Jan 6, 2020 · 17 comments
Closed
Labels

Comments

@MahmmoudSabri
Copy link

Your Environment

  • Plugin version:1.4.3+14
  • Platform:Android
  • OS version:5.0
  • Device manufacturer / model:SM-N900
  • Flutter info (flutter doctor):

[√] Flutter (Channel stable, v1.12.13+hotfix.5, on Microsoft Windows [Version 6.1.7601], locale en-US)
• Flutter version 1.12.13+hotfix.5 at C:\src\flutter
• Framework revision 27321ebbad (4 weeks ago), 2019-12-10 18:15:01 -0800
• Engine revision 2994f7e1e6
• Dart version 2.7.0
[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at C:\Users\mahmoud.sabri\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 28.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
• All Android licenses accepted.
[√] Android Studio (version 3.5)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 42.1.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
[!] IntelliJ IDEA Community Edition (version 2018.3)
• IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.3.1
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
• For information about installing plugins, see
https://flutter.dev/intellij-setup/#installing-the-plugins
[!] VS Code (version 1.38.1)
• VS Code at C:\Users\mahmoud.sabri\AppData\Local\Programs\Microsoft VS Code
X Flutter extension not installed; install from
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[√] Connected device (1 available)
• SM N900 • 340494d7e3cf119f • android-arm • Android 5.0 (API 21)
! Doctor found issues in 2 categories.

  • Plugin config:
    MainActivity
package com.transistorsoft.flutterbackgroundgeolocationexample;

import androidx.annotation.NonNull;

import io.flutter.embedding.android.FlutterActivity;
import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.plugins.GeneratedPluginRegistrant;

public class MainActivity extends FlutterActivity {
  @Override
  public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
    GeneratedPluginRegistrant.registerWith(flutterEngine);
  }
}

GeneratedPluginRegistrant

package io.flutter.plugins;

import androidx.annotation.Keep;
import androidx.annotation.NonNull;
import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.embedding.engine.plugins.shim.ShimPluginRegistry;

/**
 * Generated file. Do not edit.
 * This file is generated by the Flutter tool based on the
 * plugins that support the Android platform.
 */
@Keep
public final class GeneratedPluginRegistrant {
  public static void registerWith(@NonNull FlutterEngine flutterEngine) {
    ShimPluginRegistry shimPluginRegistry = new ShimPluginRegistry(flutterEngine);
    flutterEngine.getPlugins().add(new com.transistorsoft.flutter.backgroundfetch.BackgroundFetchPlugin());
    flutterEngine.getPlugins().add(new com.transistorsoft.flutter.backgroundgeolocation.FLTBackgroundGeolocationPlugin());
      com.lyokone.location.LocationPlugin.registerWith(shimPluginRegistry.registrarFor("com.lyokone.location.LocationPlugin"));
    flutterEngine.getPlugins().add(new io.flutter.plugins.pathprovider.PathProviderPlugin());
    flutterEngine.getPlugins().add(new io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin());
      com.tekartik.sqflite.SqflitePlugin.registerWith(shimPluginRegistry.registrarFor("com.tekartik.sqflite.SqflitePlugin"));
    flutterEngine.getPlugins().add(new io.flutter.plugins.urllauncher.UrlLauncherPlugin());
  }
}

Expected Behavior

adding any additional plugins (already used and worked in the same flutter version) worked without any problem

Actual Behavior

adding any new plugins in pubspec.yaml and use it the code , i get Unhandled Exception: MissingPluginException

Steps to Reproduce

1.add location: ^2.3.5 in pubspec.yaml Running "flutter pub get"
2.add this code in any file or in a new file

var _locationService = new Location();

bool serviceStatus = await _locationService.serviceEnabled();

3.you will got MissingPluginException

Context

i have MissingPluginException in several plugins or in any new plugin
for example

image_picker: ^0.6.2+3 , location: ^2.3.5 ,...

I do flutter clean and nothing changed
it's not about Flutter version because i do create a new project and i test one of those Libraries and everything was OK

Debug logs

Logs
E/flutter ( 4205): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method serviceEnabled on channel lyokone/location)
E/flutter ( 4205): #0      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:319:7)
E/flutter ( 4205): <asynchronous suspension>
E/flutter ( 4205): #1      Location.serviceEnabled (package:location/location.dart:74:16)
E/flutter ( 4205): #2      _HomeViewState._wifiStatus (package:flutter_background_geolocation_example/app.dart:238:49)
E/flutter ( 4205): #3      _HomeViewState.build.<anonymous closure> (package:flutter_background_geolocation_example/app.dart:228:21)
E/flutter ( 4205): #4      _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:706:14)
E/flutter ( 4205): #5      _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:789:36)
E/flutter ( 4205): #6      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24)
E/flutter ( 4205): #7      TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:486:11)
E/flutter ( 4205): #8      BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:264:5)
E/flutter ( 4205): #9      BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:199:7)
E/flutter ( 4205): #10     PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:467:9)
E/flutter ( 4205): #11     PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:76:12)
E/flutter ( 4205): #12     PointerRouter._dispatchEventToRoutes.<anonymous closure> (package:flutter/src/gestures/pointer_router.dart:117:9)
E/flutter ( 4205): #13     _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:379:8)
E/flutter ( 4205): #14     PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:115:18)
E/flutter ( 4205): #15     PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:101:7)
E/flutter ( 4205): #16     GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:218:19)
E/flutter ( 4205): #17     GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22)
E/flutter ( 4205): #18     GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7)
E/flutter ( 4205): #19     GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7)
E/flutter ( 4205): #20     GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7)
E/flutter ( 4205): #21     _rootRunUnary (dart:async/zone.dart:1138:13)
E/flutter ( 4205): #22     _CustomZone.runUnary (dart:async/zone.dart:1031:19)
E/flutter ( 4205): #23     _CustomZone.runUnaryGuarded (dart:async/zone.dart:933:7)
E/flutter ( 4205): #24     _invoke1 (dart:ui/hooks.dart:273:10)
E/flutter ( 4205): #25     _dispatchPointerDataPacket (dart:ui/hooks.dart:182:5)
E/flutter ( 4205): 
I/flutter ( 7445): [BackgroundFetch] HeadlessTask
I/flutter ( 7445): [BackgroundFetch] count: 13
@christocracy
Copy link
Member

Plugin version:1.4.3+14

There's no such version 1.4.3+14. This is the version of the /example app.

Latest version is 1.5.0.

@MahmmoudSabri
Copy link
Author

yes i know but i meant that to know i download latest version of the example app.

@christocracy
Copy link
Member

The /example is a folder within this repo. Do not quote the example version, quote the plugin version.

@MahmmoudSabri
Copy link
Author

OK can you help me ? if you understand my issue?
i do download your example from github and i add a new plugin and this is my issue.

@christocracy
Copy link
Member

Are you sure you ran Packages get?

@MahmmoudSabri
Copy link
Author

yes I'm sure and the plugin is under External Libraries -> Flutter Plugins
image

@christocracy
Copy link
Member

christocracy commented Jan 7, 2020

The /example imports 4 external dependencies. It has no problem using those.

Anyway, why are you importing the location package? Background Geolocation does everything it does and more. You don't need that.

@MahmmoudSabri
Copy link
Author

why not?i want to import any library, it seems there is something wrong or comparability issue,
can you import this library or image_picker and test it?

@christocracy
Copy link
Member

christocracy commented Jan 7, 2020

Works for me:

dependencies:
  image_picker: ^0.6.2+3

@prakashw3expert
Copy link

prakashw3expert commented Jan 9, 2020

MissingPluginException(No implementation found for method listen on channel
IOS device
why i am getting this error in my project accessing the same library.
Plz give me solution fast.

@christocracy
Copy link
Member

I made a new "hello world" project with latest flutter_background_geolocation, implemented Android headless-task and imported image_picker. It works fine on both iOS and Android.

https://github.com/transistorsoft/flutter_hello_world

@stale
Copy link

stale bot commented Mar 9, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and I will leave this open.

@stale stale bot added the stale label Mar 9, 2020
@stale
Copy link

stale bot commented Mar 16, 2020

Closing this issue after a prolonged period of inactivity. Fell free to reopen this issue, if this still affecting you.

@flutterboi
Copy link

hey, I am having this issue as well

@christocracy
Copy link
Member

@flutterboi You are providing zero information. See the first post in this thread for interesting information to provide.

@flutterboi
Copy link

I am using the same location plugin as OP. See the original post. This plugin does not work in congruence with the other location plugin.

@christocracy
Copy link
Member

I am using the same location plugin as OP

There's no way you're using the same version.

I'm not thinking about this closed issue until you provide all the required info as in OP.

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

No branches or pull requests

4 participants