flutter_foreground_task
flutter_foreground_task copied to clipboard
in release it make this issue in debug it works fine
E/flutter (12559): [ERROR:flutter/runtime/dart_isolate.cc(668)] Could not resolve main entrypoint function. E/flutter (12559): [ERROR:flutter/runtime/dart_isolate.cc(167)] Could not run the run main Dart entrypoint. E/flutter (12559): [ERROR:flutter/runtime/runtime_controller.cc(385)] Could not create root isolate. E/flutter (12559): [ERROR:flutter/shell/common/shell.cc(604)] Could not launch engine with configuration.
The W8 optimiser is stripping out the code required.
There were a few things I tried, one was to put the preprocessor statement @pragma('vm:entry-point')
before the global function that called my ForegroundTask.
Here is a reference, https://stackoverflow.com/questions/73514653/flutter-isolate-not-working-in-release-mode-on-android
This pragma directive solved the problem for me.
I suggest that a mention of this in the readme would be a useful addition.
-- Edit, I see that it's been added already. Thanks 👍