flutter_background_service icon indicating copy to clipboard operation
flutter_background_service copied to clipboard

Does this lib still work?

Open cnayan opened this issue 1 year ago • 5 comments

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)

cnayan avatar Nov 01 '23 17:11 cnayan

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.

plants-buddy avatar Nov 05 '23 10:11 plants-buddy

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 avatar Nov 05 '23 19:11 ChanakaDev

@ChanakaDev I have the same problem.

bahman2000 avatar Nov 06 '23 10:11 bahman2000

I have the same problem.

habibfakari avatar Nov 06 '23 10:11 habibfakari

SDK 34 adds some extra permission requirements - a fix for this has just landed: https://github.com/ekasetiawans/flutter_background_service/pull/374

insertjokehere avatar Nov 06 '23 20:11 insertjokehere