NordicSemiconductor / Android-DFU-Library

Device Firmware Update library and Android app
http://www.nordicsemi.com/dfu
BSD 3-Clause "New" or "Revised" License
753 stars 263 forks source link

Causing MissingForegroundServiceTypeException on android 14 #436

Closed msusman1 closed 5 months ago

msusman1 commented 5 months ago

Where do you suspect the issue?

Other

Version

2.4.1 (Latest)

Describe the issue

I am getting below error on DFU start on android 14 Fatal Exception: android.app.MissingForegroundServiceTypeException: Starting FGS without a type callerApp=ProcessRecord{e219d6e 12018:be.lopos.android/u0a435} targetSDK=34

Relevant log output

No response

msusman1 commented 5 months ago

I managed to fix the crash by including the foreground service permission android.permission.FOREGROUND_SERVICE_LOCATION and adding the foregroundServiceType flag in the DFuService declaration in the AndroidManifest.