open the file .dart_tool/flutter_build/dart_plugin_registrant.dart
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');
}
1.create a plugin by dartPluginClass
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' ); }} } `