NordicSemiconductor / Android-DFU-Library

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

Android 12+ bug #399

Closed dillanspencer closed 1 year ago

dillanspencer commented 1 year ago

DFU Bootloader version (please complete the following information):

Device information (please complete the following information):

Your question

I get this error when trying to run a DFU

Logs


FATAL EXCEPTION: IntentService[DfuBaseService]
Process: com.brnkl.app, PID: 17698
java.lang.IllegalArgumentException: com.brnkl.app: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
    at android.app.PendingIntent.checkFlags(PendingIntent.java:408)
    at android.app.PendingIntent.getActivityAsUser(PendingIntent.java:491)
    at android.app.PendingIntent.getActivity(PendingIntent.java:477)
    at android.app.PendingIntent.getActivity(PendingIntent.java:441)
    at no.nordicsemi.android.dfu.DfuBaseService.startForeground(DfuBaseService.java:1862)
    at no.nordicsemi.android.dfu.DfuBaseService.onHandleIntent(DfuBaseService.java:1142)
    at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:78)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loopOnce(Looper.java:226)
    at android.os.Looper.loop(Looper.java:313)
    at android.os.HandlerThread.run(HandlerThread.java:67)
dillanspencer commented 1 year ago

Update to 1.12.0+ fixes this error. I get an error with android permissions after updating though