A very strange issue. I am using https://pub.dev/packages/home_widget and I am trying to use the backgroundCallback to refresh my widget by pressing an image on the widget. It works fine on debug mode, however when I build apk or run flutter run --release --verbose I get the error below (well in apk I can't see the error but it does not work either).
I get this error after tapping the image with the callback URI:
[+7444 ms] E/flutter ( 9412): [ERROR:flutter/shell/common/shell.cc(93)] Dart Error: Dart_LookupLibrary: library
'package:home_widget/home_widget_callback_dispatcher.dart' not found.
[ +2 ms] E/flutter ( 9412): [ERROR:flutter/runtime/dart_isolate.cc(668)] Could not resolve main entrypoint function.
[ ] E/flutter ( 9412): [ERROR:flutter/runtime/dart_isolate.cc(167)] Could not run the run main Dart entrypoint.
[ ] E/flutter ( 9412): [ERROR:flutter/runtime/runtime_controller.cc(385)] Could not create root isolate.
[ ] E/flutter ( 9412): [ERROR:flutter/shell/common/shell.cc(604)] Could not launch engine with configuration.
That makes no sense to me. You can see here that the file is in my package beside the other one. Does anyone know why this might happen?
What confuses me is that it is working fine in Debug.
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 3.4.0-19.0.pre.35, on Microsoft Windows [Version 10.0.22000.856], locale en-CA)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[✓] Chrome - develop for the web
[✗] Visual Studio - develop for Windows
✗ Visual Studio not installed; this is necessary for Windows development.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[✓] Android Studio (version 2021.2)
[✓] VS Code, 64-bit edition (version 1.67.2)
[✓] Connected device (4 available)
[✓] HTTP Host Availability