Closed mehmetext closed 2 years ago
I fixed this error by adding @pragma('vm:entry-point')
on a top line of headless callbackDispatcher
function. So like this:
@pragma('vm:entry-point')
void callbackDispatcher() {
Workmanager().executeTask((task, inputData) async {
print("Native called background task: $task");
....
return Future.value(true);
});
}
I met the exact same issue and this works for me too!
Same, waiting on confirmation from production. @ened This is probably due to the latest Dart SDK shipped with Flutter 3. Please update the readme to mention this issue, it could help a lot of people !
I fixed this error by adding
@pragma('vm:entry-point')
on a top line of headlesscallbackDispatcher
function. So like this:@pragma('vm:entry-point') void callbackDispatcher() { Workmanager().executeTask((task, inputData) async { print("Native called background task: $task"); .... return Future.value(true); }); }
Yeah, this works. Thanks for that! Although, this issue probably shouldn't be closed until this is corrected either with Flutter/Dart or within the plugin itself, if possible. In addition, I was experiencing this issue in my debug build, so it's not only affecting release builds. @mehmetext
Version
Describe the error The workmanager works debug mode with no problem but when I do "flutter run --release" on my phone, I get there errors:
Output of
flutter doctor -v