flutter_foreground_task icon indicating copy to clipboard operation
flutter_foreground_task copied to clipboard

in release it make this issue in debug it works fine

Open primekhan555 opened this issue 2 years ago • 1 comments

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.

primekhan555 avatar Oct 18 '22 07:10 primekhan555

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

CH-Potter avatar Oct 18 '22 08:10 CH-Potter

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 👍

builtbybrayne avatar Nov 01 '22 17:11 builtbybrayne