I have this issue on my Pixel 6a with Android 14.
Whern trying to launch the foreground task, the app crash with the fllowing message :
java.lang.RuntimeException: Unable to create service com.pravera.flutter_foreground_task.service.ForegroundService: android.app.MissingForegroundServiceTypeException: Starting FGS without a type callerApp=ProcessRecord{907349 32028:fr.kip.app/u0a481} targetSDK=34
I have found the solution, I'll give it here and open a PR to add this info in the documentation.
As it is mentionned here in the Android Guidelines, in Android 14, to start a FG service, you need to specify its type.
I have this issue on my Pixel 6a with Android 14. Whern trying to launch the foreground task, the app crash with the fllowing message :
I have found the solution, I'll give it here and open a PR to add this info in the documentation.
As it is mentionned here in the Android Guidelines, in Android 14, to start a FG service, you need to specify its type.
https://developer.android.com/about/versions/14/changes/fgs-types-required
So you need to add in your manifest the following code :
Change the type with your type (all types are listed in the link above). Beware, certzin type have some requirements to be met to work.