Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unhandled Exception: MissingPluginException(No implementation found

i have a problem in several plugins

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

I do flutter clean and nothing changed

Android device :SM-N900

Android Version:5.0

MainActivity

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 io.flutter.plugins.deviceinfo.DeviceInfoPlugin());
      io.flutter.plugins.imagepicker.ImagePickerPlugin.registerWith(shimPluginRegistry.registrarFor("io.flutter.plugins.imagepicker.ImagePickerPlugin"));
      com.lyokone.location.LocationPlugin.registerWith(shimPluginRegistry.registrarFor("com.lyokone.location.LocationPlugin"));
    flutterEngine.getPlugins().add(new io.flutter.plugins.pathprovider.PathProviderPlugin());
      flutter.plugins.screen.screen.ScreenPlugin.registerWith(shimPluginRegistry.registrarFor("flutter.plugins.screen.screen.ScreenPlugin"));
    flutterEngine.getPlugins().add(new io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin());
      com.tekartik.sqflite.SqflitePlugin.registerWith(shimPluginRegistry.registrarFor("com.tekartik.sqflite.SqflitePlugin"));
      altercode.xyz.uniqueidentifier.UniqueIdentifierPlugin.registerWith(shimPluginRegistry.registrarFor("altercode.xyz.uniqueidentifier.UniqueIdentifierPlugin"));
    flutterEngine.getPlugins().add(new io.flutter.plugins.urllauncher.UrlLauncherPlugin());
  }
}

flutter doctor

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
 Flutter (Channel stable, v1.12.13+hotfix.5, on Microsoft Windows [Version
    6.1.7601], locale en-US)
 Android toolchain - develop for Android devices (Android SDK version 28.0.
3)
 Android Studio (version 3.5)
[!] IntelliJ IDEA Community Edition (version 2018.3)
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
[!] VS Code (version 1.38.1)
    X Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[!] Connected device
    ! No devices available

! Doctor found issues in 3 categories.

One of My Exceptions is :

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

And my code :

var _locationService = new Location();

bool serviceStatus = await _locationService.serviceEnabled();
like image 472
Mahmoud Sabri Avatar asked Nov 07 '22 10:11

Mahmoud Sabri


1 Answers

Have you tried running a restart after adding the plugin? Running the app using hot reload may have yet to include the plugin that you've recently added on your build.

like image 109
Omatt Avatar answered Nov 15 '22 07:11

Omatt