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

MissingPluginException #9

Open
Mariluk opened this issue Aug 29, 2018 · 3 comments
Open

MissingPluginException #9

Mariluk opened this issue Aug 29, 2018 · 3 comments

Comments

@Mariluk
Copy link

Mariluk commented Aug 29, 2018

I/flutter (29128): The following MissingPluginException was thrown while activating platform stream on channel I/flutter (29128): plugins.flutter.io/receiveshare: I/flutter (29128): MissingPluginException(No implementation found for method listen on channel I/flutter (29128): plugins.flutter.io/receiveshare)

`Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, v0.7.3-pre.26, on Linux, locale cs_CZ.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
[✓] Android Studio (version 3.1)
[✓] IntelliJ IDEA Ultimate Edition (version 2018.1)
[✓] Connected devices (1 available)

• No issues found!
`

@Mariluk
Copy link
Author

Mariluk commented Aug 29, 2018

only in new project .. your example project after clone work fine

My pubspec:

dependencies:
flutter:
sdk: flutter
share:
git:
url: https://github.com/d-silveira/flutter-share.git

@mattetti
Copy link

mattetti commented Dec 23, 2018

confirmed, same here.

After digging through how Flutter builds work and checking all the dependencies, turns out the problem is much simpler. The MainActivity that is created in a new project looks like that:

import android.os.Bundle;
import io.flutter.app.FlutterActivity;
import io.flutter.plugins.GeneratedPluginRegistrant;

public class MainActivity extends FlutterActivity {
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    GeneratedPluginRegistrant.registerWith(this);
  }
}

The thing is, for this plugin to work, you need not to extend FlutterActivity but FlutterShareReceiverActivity.

Change your MainActivity.java file content to reflect this change:

import android.os.Bundle;
import io.flutter.plugins.GeneratedPluginRegistrant;
import io.flutter.plugins.share.FlutterShareReceiverActivity;


public class MainActivity extends FlutterShareReceiverActivity {
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    GeneratedPluginRegistrant.registerWith(this);
  }
}

And everything will be fine (don't forget to import FlutterSharedReceiverActivity).Turns out, this is mentioned in the README, but like you, I missed it.

@eboye
Copy link

eboye commented Apr 1, 2019

Hmm, but when I do this and I'm using path_provider plugin, it get's this error:

E/flutter (27478): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: MissingPluginException(No implementation found for method getApplicationDocumentsDirectory on channel plugins.flutter.io/path_provider)

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

No branches or pull requests

3 participants