flutter_background_service
flutter_background_service copied to clipboard
Does this lib still work?
I am developing for Android.
The example from https://pub.dev/packages/flutter_background_service straight out of the box doesn't build. Forced me to target SDK 34.
Then, the documentation don't specify the dependencies and permissions. I had to add these by observing the exceptions:
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
<uses-permission android:name="android.permission.USE_EXACT_ALARM" />
and then I get exception that I cannot resolve:
D/AndroidRuntime( 6904): Shutting down VM E/AndroidRuntime( 6904): FATAL EXCEPTION: main E/AndroidRuntime( 6904): Process: com.my.application, PID: 6904 E/AndroidRuntime( 6904): java.lang.RuntimeException: Unable to create service id.flutter.flutter_background_service.BackgroundService: android.app.MissingForegroundServiceTypeException: Starting FGS without a type callerApp=ProcessRecord{dba3eb6 6904:com.my.application/u0a190} targetSDK=34 E/AndroidRuntime( 6904): at android.app.ActivityThread.handleCreateService(ActivityThread.java:4664)
Getting the same exception. Did you find any solution? I am getting this exception for devices with SDK 34, but it's working fine for devices below SDK 34.
I/flutter (26472): flutter_background_service_android
threw an error: Exception: This class should only be used in the main isolate (UI App). The app may not function as expected until you remove this plugin from pubspec.yaml
I am getting this error
@ChanakaDev I have the same problem.
I have the same problem.
SDK 34 adds some extra permission requirements - a fix for this has just landed: https://github.com/ekasetiawans/flutter_background_service/pull/374