MissingPluginException(No implementation

6,917 views
Skip to first unread message

K leo

unread,
Jul 17, 2020, 8:55:58 AM7/17/20
to Flutter Development (flutter-dev)
I try to run an app from github (https://github.com/awaik/todo_hive_example).  I got it run on Android.  But when I run it on Linux, I got this "method not implemented" error.  I wonder if this is real or something I have not configured correctly.  Where is the relevant file for me to check?  Any suggestions please.

$ flutter run  
Running "flutter pub get" in todo_hive_example...                   1.2s

Launching lib/main.dart on Linux in debug mode...

Building Linux application...                                            
Waiting for Linux to report its views...                             9ms

Syncing files to device Linux...                                   535ms


An Observatory debugger and profiler on Linux is available at: http://127.0.0.1:38557/FgROiCCrfgo=/

[ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: MissingPluginException(No implementation fou
nd
for method getApplicationDocumentsDirectory on channel plugins.flutter.io/path_provider)

#0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:159:7)

<asynchronous suspension>

#1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:334:12)

#2      MethodChannelPathProvider.getApplicationDocumentsPath (package:path_provider_platform_interface/src/me
thod_channel_path_provider
.dart:50:10)

#3      getApplicationDocumentsDirectory (package:path_provider/path_provider.dart:76:39)

#4      HiveX.initFlutter (package:hive_flutter/src/hive_extensions.dart:11:26)

#5      main (package:todo_hive_example/main.dart:10:14)

#6      _runMainZoned.<anonymous closure>.<anonymous closure> (dart:ui/hooks.dart:233:25)

#7      _rootRun (dart:async/zone.dart:1190:13)

#8      _CustomZone.run (dart:async/zone.dart:1093:19)

#9      _runZoned (dart:async/zone.dart:1630:10)

#10     runZonedGuarded (dart:async/zone.dart:1618:12)

#11     _runMainZoned.<anonymous closure> (dart:ui/hooks.dart:225:5)

#12     _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:301:19)

#13     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)


$ flutter -v doctor

[✓] Flutter (Channel dev, 1.20.0-7.1.pre, on Linux, locale en_US.UTF-8)

    Flutter version 1.20.0-7.1.pre at /home/xxx/Software/flutter

    Framework revision 7736f3bc90 (7 days ago), 2020-07-10 16:33:05 -0700

    Engine revision d48085141c

    Dart version 2.9.0 (build 2.9.0-21.2.beta)



 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)

    Android SDK at /home/xxx/Software/Android

    Platform android-29, build-tools 29.0.2

    ANDROID_HOME = /home/xxx/Software/Android

    ANDROID_SDK_ROOT = /home/xxx/Software/Android

    Java binary at: /home/xxx/Software/android-studio/jre/bin/java

    Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

    All Android licenses accepted.



[✓] Linux toolchain - develop for Linux desktop

    clang version 10.0.0-4ubuntu1

    cmake version 3.16.3

    ninja version 1.10.0

    pkg-config version 0.29.1



[✓] Android Studio (version 4.0)

    Android Studio at /home/xxx/Software/android-studio

    Flutter plugin version 47.1.2

    Dart plugin version 193.7361

    Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)



[✓] Connected device (1 available)

    Linux (desktop) linux linux-x64 Linux



No issues found!




Souvik Dutta

unread,
Jul 17, 2020, 9:11:20 AM7/17/20
to K leo, Flutter Development (flutter-dev)
This is probably because of a platform specific code which is not handled properly. It won't run anywhere other than android. Because the apis and methods provider by android are not the same as the apis and methods provided by linux. You will have find a file that is using platform channels. Then wrap the code with a try and except block which should solve the problem. 

--
You received this message because you are subscribed to the Google Groups "Flutter Development (flutter-dev)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/17b33c33-4993-4e5d-b1af-2d54f4d24da3o%40googlegroups.com.

Adeola

unread,
Jul 17, 2020, 9:19:21 AM7/17/20
to Flutter Development (flutter-dev)
Yes you are correct @souvik. "getApplicationDocumentsDirectory" , refers to the path_provider package. The path_provider package won't work on linux but rather path_provider_linux would work.

Stuart Morgan

unread,
Jul 17, 2020, 9:38:15 PM7/17/20
to Adeola, Flutter Development (flutter-dev)
On Fri, Jul 17, 2020 at 6:19 AM Adeola <inbox...@gmail.com> wrote:
The path_provider package won't work on linux

path_provider works on Linux as of version 1.6.10. The issue here is that the project in question has pinned path_provider to 1.6.5
 
but rather path_provider_linux would work.

path_provdier_linux is the federated implementation of path_provider for Linux, and is automatically used in the current version of path_provider. There is rarely a reason to use a federated platform implementation directly.

-Stuart 

K leo

unread,
Jul 18, 2020, 3:43:07 AM7/18/20
to Flutter Development (flutter-dev)
Thanks Stuart for clarifying.

The project did not set dependency on path_provider.  It is a dependency of hive_flutter.

But Anyhow, I upgraded flutter yesterday to the newest dev (it was a version just about a week old), and had to add a couple dependency_overrides (not related to path_provider), now the app works on Linux.

pubspec:
name: todo_hive_example
description: Very simple todo app made with Hive.

version: 1.0.0+1

environment:
 sdk: ">=2.1.0 <3.0.0"

dependencies:
 flutter:
   sdk: flutter

  cupertino_icons: ^0.1.3
 hive: ^1.4.1+1
 hive_flutter: ^0.3.0+2

dev_dependencies:
#  flutter_test:
#    sdk: flutter
 hive_generator: ^0.7.0+2
 build_runner: ^1.8.1

dependency_overrides:
 dartx: ^0.4.0
 collection: ">=1.14.0 <1.16.0"

flutter:
 uses-material-design: true



Stuart Morgan

unread,
Jul 18, 2020, 10:49:44 AM7/18/20
to K leo, Flutter Development (flutter-dev)
On Sat, Jul 18, 2020 at 12:43 AM K leo <cnbi...@gmail.com> wrote:
The project did not set dependency on path_provider.

It checked in a pubspec.lock, however; see the link in my previous email.

-Stuart 
Reply all
Reply to author
Forward
0 new messages