Add service tag in Manifest.XML

Custom Code

I am trying to use foreground services however when I am building my app I get this error:

E/AndroidRuntime(17310): java.lang.RuntimeException: Unable to create service id.flutter.flutter_background_service.BackgroundService: android.app.MissingForegroundServiceTypeException: Starting

the flutter_background_service package I am using does not require a service tag in manifest, but still is failing the build.

On my permissions tab (and android manifest) I have the uses-permission for FOREGROUND_SERVICE and FOREGROUND_SERVICE_LOCATION

What have you tried so far?

Tried:

  • user a different package version (upgrading to latest and min version)

  • latest version requires to add Service tag under Application tag but Flutterflow says that it cant recognize Service Tag

  • using the min version 5.0.4 which doesnt require the Service tag I get the error below:

E/AndroidRuntime(17310): java.lang.RuntimeException: Unable to create service id.flutter.flutter_background_service.BackgroundService: android.app.MissingForegroundServiceTypeException: Starting

Did you check FlutterFlow's Documentation for this topic?
No
1