sony / flutter-embedded-linux

Embedded Linux embedding for Flutter
BSD 3-Clause "New" or "Revised" License
1.16k stars 122 forks source link

Missing calls to "registerWith()" in generated dart_plugin_registrant.dart #398

Closed zr6328 closed 8 months ago

zr6328 commented 8 months ago

1.create a plugin by dartPluginClass

  1. create a flutter project
  2. compile the app by using cross-build's method
  3. open the file .dart_tool/flutter_build/dart_plugin_registrant.dart
  4. find the symbol of registerWith in libapp.so

In linux-x64,the symbol of registerWith exists in libapp.so, but in linux-arm64,we can't find the registerWith in libapp.so

the plugin's code look like this: plugin: implements: plugin_platform_template_interface platforms: macos: dartPluginClass: FlutterMacPlugin the dart_plugin_registrant.dart look like this: @pragma('vm:entry-point') class _PluginRegistrant { @pragma('vm:entry-point') static void register() { print('zrzrzrzr register function called!!!!'); if (Platform.isAndroid) { print("zrzrzrzr platform is android"); } else if (Platform.isIOS) { print("zrzrzrzr platform is ios"); } else if (Platform.isLinux) { print("zrzrzrzr platform is Linux"); try { FlutterLinuxPlugin.registerWith(); } catch (err) { print( 'flutter_linux_plugin` threw an error: $err. ' 'The app may not function as expected until you remove this plugin from pubspec.yaml' ); }

} else if (Platform.isMacOS) {
  print("zrzrzrzr platform is Macos");
  try {
    FlutterMacPlugin.registerWith();
  } catch (err) {
    print(
      '`flutter_mac_plugin` threw an error: $err. '
      'The app may not function as expected until you remove this plugin from pubspec.yaml'
    );
  }

} else if (Platform.isWindows) {
  print('zrzrzrzr platform is Windows');
}

} } `

zr6328 commented 8 months ago

error