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

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

Closed
zr6328 opened this issue Oct 31, 2023 · 1 comment
Closed

Comments

@zr6328
Copy link

zr6328 commented Oct 31, 2023

1.create a plugin by dartPluginClass
2. create a flutter project
3. compile the app by using cross-build's method
4. open the file .dart_tool/flutter_build/dart_plugin_registrant.dart
5. 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 zr6328 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 31, 2023
@zr6328
Copy link
Author

zr6328 commented Oct 31, 2023

error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant