mintware-de / flutter_p2p

A Wi-Fi Direct Plugin for Flutter
MIT License
79 stars 42 forks source link

there's an issue at startup the program #13

Open simon-jonghun-song opened 4 years ago

simon-jonghun-song commented 4 years ago

I have a problem to run flutter_p2p test app as below. E/flutter ( 2735): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method isLocationPermissionGranted on channel de.mintware.flutter_p2p/flutter_p2p)

How can I solve it?


  1. When compile & run the this app, I can see this log

Launching lib/main.dart on Pixel 2 in debug mode... Running Gradle task 'assembleDebug'... ✓ Built build/app/outputs/apk/debug/app-debug.apk. E/flutter ( 2735): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method isLocationPermissionGranted on channel de.mintware.flutter_p2p/flutter_p2p) E/flutter ( 2735): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:154:7) E/flutter ( 2735): E/flutter ( 2735): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:329:12) E/flutter ( 2735): #2 FlutterP2p.isLocationPermissionGranted (package:flutter_p2p/plugin.dart:24:27) E/flutter ( 2735): #3 _MyAppState._checkPermission (package:flutter_p2p_example/main.dart:149:27) E/flutter ( 2735): #4 _MyAppState._register (package:flutter_p2p_example/main.dart:61:16) E/flutter ( 2735): #5 _MyAppState.initState (package:flutter_p2p_example/main.dart:41:5) E/flutter ( 2735): #6 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4640:58) E/flutter ( 2735): #7 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4476:5) E/flutter ( 2735): #8 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3446:14) E/flutter ( 2735): #9 Element.updateChild (package:flutter/src/widgets/framework.dart:3214:18) E/flutter ( 2735): #10 RenderObjectToWidgetElement._rebuild (package:flutter/src/widgets/binding.dart:1148:16) E/flutter ( 2735): #11 RenderObjectToWidgetElement.mount (package:flutter/src/widgets/binding.dart:1119:5) E/flutter ( 2735): #12 RenderObjectToWidgetAdapter.attachToRenderTree. (package:flutter/src/widgets/binding.dart:1061:17) E/flutter ( 2735): #13 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2607:19) E/flutter ( 2735): #14 RenderObjectToWidgetAdapter.attachToRenderTree (package:flutter/src/widgets/binding.dart:1060:13) E/flutter ( 2735): #15 WidgetsBinding.attachRootWidget (package:flutter/src/widgets/binding.dart:941:7) E/flutter ( 2735): #16 WidgetsBinding.scheduleAttachRootWidget. (package:flutter/src/widgets/binding.dart:922:7) E/flutter ( 2735): #17 _rootRun (dart:async/zone.dart:1180:38) E/flutter ( 2735): #18 _CustomZone.run (dart:async/zone.dart:1077:19) E/flutter ( 2735): #19 _CustomZone.runGuarded (dart:async/zone.dart:979:7) E/flutter ( 2735): #20 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:1019:23) E/flutter ( 2735): #21 _rootRun (dart:async/zone.dart:1184:13) E/flutter ( 2735): #22 _CustomZone.run (dart:async/zone.dart:1077:19) E/flutter ( 2735): #23 _CustomZone.bindCallback. (dart:async/zone.dart:1003:23) E/flutter ( 2735): #24 Timer._createTimer. (dart:async-patch/timer_patch.dart:23:15) E/flutter ( 2735): #25 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398:19) E/flutter ( 2735): #26 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429:5) E/flutter ( 2735): #27 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12) E/flutter ( 2735): Debug service listening on ws://127.0.0.1:53833/Cv1vB8KrBmg=/ws Syncing files to device Pixel 2...


  1. When I tab the 'Discover Devices', I can see below log

    E/flutter ( 2735): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method discover on channel de.mintware.flutter_p2p/flutter_p2p) E/flutter ( 2735): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:154:7) E/flutter ( 2735): E/flutter ( 2735): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:329:12) E/flutter ( 2735): #2 FlutterP2p.discoverDevices (package:flutter_p2p/plugin.dart:48:27) E/flutter ( 2735): #3 _MyAppState.build. (package:flutter_p2p_example/main.dart:192:53) E/flutter ( 2735): #4 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:779:19) E/flutter ( 2735): #5 _InkResponseState.build. (package:flutter/src/material/ink_well.dart:862:36) E/flutter ( 2735): #6 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24) E/flutter ( 2735): #7 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:504:11) E/flutter ( 2735): #8 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:282:5) E/flutter ( 2735): #9 BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:217:7) E/flutter ( 2735): #10 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:475:9) E/flutter ( 2735): #11 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:76:12) E/flutter ( 2735): #12 PointerRouter._dispatchEventToRoutes. (package:flutter/src/gestures/pointer_router.dart:122:9) E/flutter ( 2735): #13 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:379:8) E/flutter ( 2735): #14 PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:120:18) E/flutter ( 2735): #15 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:106:7) E/flutter ( 2735): #16 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:218:19) E/flutter ( 2735): #17 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22) E/flutter ( 2735): #18 GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7) E/flutter ( 2735): #19 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7) E/flutter ( 2735): #20 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7) E/flutter ( 2735): #21 _rootRunUnary (dart:async/zone.dart:1196:13) E/flutter ( 2735): #22 _CustomZone.runUnary (dart:async/zone.dart:1085:19) E/flutter ( 2735): #23 _CustomZone.runUnaryGuarded (dart:async/zone.dart:987:7) E/flutter ( 2735): #24 _invoke1 (dart:ui/hooks.dart:275:10) E/flutter ( 2735): #25 _dispatchPointerDataPacket (dart:ui/hooks.dart:184:5) E/flutter ( 2735):

flutter verion is ➜ example dart --version Dart VM version: 2.8.2 (stable) (Mon May 11 15:06:42 2020 +0200) on "macos_x64" ➜ example

devtronic commented 4 years ago

I'm already working on a fix. The problem is the method invocation by reflection. Proguard removes the methods accidentally because "they are not used".

caustav commented 4 years ago

Any update on the fix. Am also getting the same error.