Skip to content

Obfuscating a Flutter app can cause plugins to fail #35764

@bparrishMines

Description

@bparrishMines

When calling invokeMethod, some plugins use a method name along the lines of $ClassName#MethodName. When trying to obfuscate the dart code in a flutter app, this may inadvertently change the class names on the dart side, but not the native side.

For example invokeMethod('$Adder#add') would be replaced with invokeMethod('$zza#add').

I'm not sure of all plugins that would be affected by this, but firebase_ml_vision and firebase_performance use this format.

This could be solved by just removing the $ in front of the method name.

Related comment: flutter/plugins@90ed52d#commitcomment-34121822

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: crashStack traces logged to the consolep: firebaseFirebase pluginsp: firebase_ml_visionThe Firebase ML Vision pluginp: firebase_performanceFirebase Performance pluginpackageflutter/packages repository. See also p: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions