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

[BUG] Cannot Build app using Flutter Master Channel #116

Closed
ThinkDigitalSoftware opened this issue Nov 14, 2019 · 6 comments
Closed

[BUG] Cannot Build app using Flutter Master Channel #116

ThinkDigitalSoftware opened this issue Nov 14, 2019 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@ThinkDigitalSoftware
Copy link

Describe the bug
The app will launch and immediately crash. This seems to be an issue with the few Flutter Plugin View or something. I linked to a similar issue with the camera.
To Reproduce
Steps to reproduce the behavior:
add this plugin to the pubspec.yaml while on master and try to run it

Technical Details:

  • [✓] Flutter (Channel master, v1.10.17-pre.58, on Mac OS X 10.15.2 19C39d, locale en-US)

Additional context
see flutter/flutter#40423

Stacktrace

D/FlutterActivityAndFragmentDelegate( 3255): Setting up FlutterEngine.
D/FlutterActivityAndFragmentDelegate( 3255): No preferred FlutterEngine was provided. Creating a new FlutterEngine for this FlutterFragment.
W/FlutterEngine( 3255): Tried to automatically register plugins with FlutterEngine (io.flutter.embedding.engine.FlutterEngine@aa7959b) but could not find and invoke the GeneratedPluginRegistrant.
D/FlutterActivityAndFragmentDelegate( 3255): Attaching FlutterEngine to the Activity that owns this Fragment.

@ThinkDigitalSoftware ThinkDigitalSoftware added the bug Something isn't working label Nov 14, 2019
@sarbagyastha
Copy link
Owner

@ThinkDigitalSoftware It's an issue due to v2 embedding of PlatformViews. The workaround is to migrate from GeneratedPluginRegistrant to adding the plugin to flutter-engine.

As in the example, use MainActivity.java instead of old one(i.e. v1).

@ThinkDigitalSoftware
Copy link
Author

Oh, I didn't realize this wasn't a plugin error. OK, thank you!

@ThinkDigitalSoftware
Copy link
Author

ThinkDigitalSoftware commented Nov 14, 2019

What am i supposed to be adding?
with the code

public class MainActivity extends FlutterActivity {
  @Override
  public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
    flutterEngine.getPlugins().add(new WebViewFlutterPlugin());
  }
}
It throws the following error

error: no suitable method found for add(WebViewFlutterPlugin)
method PluginRegistry.add(FlutterPlugin) is not applicable
(argument mismatch; WebViewFlutterPlugin cannot be converted to FlutterPlugin)

@sarbagyastha
Copy link
Owner

@ThinkDigitalSoftware Just tested on Flutter (Channel master, v1.11.1-pre.48) and got no crashes without even performing the workarounds.

@ThinkDigitalSoftware
Copy link
Author

ThinkDigitalSoftware commented Nov 14, 2019 via email

@ThinkDigitalSoftware
Copy link
Author

I flutter deleted the android folder and recreated it with flutter create and switched to stable and it builds fine. I'll switch to master and try again later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants