Skip to content

[android_platform] GeneratedPluginsRegister logging is not meaningful for troubleshooting plugins #81361

@rh-id

Description

@rh-id

Steps to Reproduce

Please find steps together with reproducible example https://github.com/rh-id/example_fp_exception

  1. Create problematic flutter plugin using Android Studio 4.1.3
  2. Modify the plugin to throw runtime exception at onAttachedToEngine
  3. A non-helpful warning message will be printed instead of exception information or exception stacks
W/GeneratedPluginsRegister: Tried to automatically register plugins with FlutterEngine
(io.flutter.embedding.engine.FlutterEngine@aed2c5e) but could not find and invoke the
GeneratedPluginRegistrant.
  1. This can become an issue if user have many plugins on their project, as there is no way to know which plugin cause an issue. worse thing is that the log will print MissingPluginException on other plugin instead which is misleading.
Doctor
[✓] Flutter (Channel stable, 2.0.4, on Linux, locale en_US.UTF-8)
    • Flutter version 2.0.4 at /home/rubyh/Flutter/flutter
    • Framework revision b1395592de (4 weeks ago), 2021-04-01 14:25:01 -0700
    • Engine revision 2dce47073a
    • Dart version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /home/rubyh/Android/Sdk
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = /home/rubyh/Android/Sdk
    • ANDROID_SDK_ROOT = /home/rubyh/Android/Sdk
    • Java binary at: /usr/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+9-Ubuntu-0ubuntu1.20.04)
    • All Android licenses accepted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: pluginsSupport for writing, building, and running plugin packagesfound in release: 2.0Found to occur in 2.0found in release: 2.3Found to occur in 2.3has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyteam-androidOwned by Android platform teamtriaged-androidTriaged by Android platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions