Skip to content

Unhandled Exception: MissingPluginException(No implementation found #169

@MahmmoudSabri

Description

@MahmmoudSabri

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions