Even using annotate @pragma('vm:entry-point') code does not work in release mode

1.7k Views Asked by At

I got an issue in the release mode APK. I am implementing some code in the serviceMain function. It works fine in debug mode, but when I am building apk as release mode. The code is not working.

What I am trying to do is, I'm implementing a function where I need to clean previously scheduled notification from notification tray and need to call and API to server. For this I'm using local database to store cache of notification so I'm updating every time I get notification and delete on some conditions.

So I've added two entry point in my main file one is for main application and another for foreground service. This is working fine in debug mode but not working in release mode.

I'm using android-long-task library for foreground execution. And also below are dependencies in my project.

android_long_task: ^1.0.0
focused_menu: ^1.0.5
cupertino_icons: ^0.1.3
cached_network_image: ^2.0.0
flutter_switch: ^0.0.2
drawerbehavior: ^1.0.0
toast: ^0.1.5
pull_to_refresh: ^2.0.0
keyboard_visibility: ^0.5.6
get_it: ^7.2.0
syncfusion_flutter_charts: ^19.4.48
shared_preferences:
url_launcher:
youtube_player_flutter:
firebase_messaging: ^10.0.9
firebase_auth: ^3.3.1
firebase_core: any
flutter_local_notifications: ^9.3.2 #2.0.0
image_picker: any
flutter_image_compress:
uuid:
flutter_native_timezone: ^1.0.5
awesome_notifications: ^0.6.21
sqflite: ^2.0.0+3
path: ^1.8.0
intl: ^0.17.0
localdb: ^0.0.3
0

There are 0 best solutions below