Salt-PepperEngineering / react-native-nordic-dfu

Nordic Device Firmware Update for React Native
MIT License
30 stars 36 forks source link

RECEIVER_EXPORTED / RECEIVER_NOT_EXPORTED Flag Requirement (Android 14) #19

Closed slothwerks-studio closed 4 months ago

slothwerks-studio commented 4 months ago

Hey, everyone!

I'm using this fork in a project and, after an update to React Native 0.74.x, I'm encountering an error when attempting to connect to a Nordic device for the DFU process.

Unable to create service com.pilloxa.dfu.DfuService: java.lang.SecurityException: com.fleetwoodgroup.heelupdate: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts

Per this article on Stack Overflow, it looks like this is a requirement for Android 14 and above. My React Native update, of course, is now targeting API level 34.

        buildToolsVersion = "34.0.0"
        minSdkVersion = 23
        compileSdkVersion = 34
        targetSdkVersion = 34
        ndkVersion = "26.1.10909125"
        kotlinVersion = "1.9.22"

It looks like this issue was fixed on Nordic's side:

https://github.com/NordicSemiconductor/Android-DFU-Library/pull/415

How do we ensure this fix is included here in this project?

slothwerks-studio commented 4 months ago

Okay... I'm seeing that manualexSP merged this fix recently; I'm wondering if my codebase isn't including the update. Will look into this and see if I can pull the latest from master.

slothwerks-studio commented 4 months ago

Wound up removing the react-native-nordic-dfu package and then re-added it, specifying the commit hash. Not sure if this is a yarn issue (why wasn't yarn picking up the latest commits from master?), but I was able to get everything updated and we're back in business.

Thank you for maintaining this library! 🤩