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

[Version Android - 14] - java.lang.SecurityException: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts #412

Closed vasim1422 closed 11 months ago

vasim1422 commented 11 months ago

Where do you suspect the issue?

Issue related to Android version or specific device

Version

2.3.1 (Latest)

Describe the issue

App crashing in Android 14 due to exception of java.lang.SecurityException One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts. more log attached

implementation 'no.nordicsemi.android:dfu:2.3.1'

Please provide quick help on this as this issue occurred in our production product in which used your services.

Thanks

Relevant log output

java.lang.RuntimeException: Unable to create service no.nordicsemi.android.dfu
.DfuBaseService: java.lang.SecurityException: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts    at android.app.ActivityThread.handleCreateService(ActivityThread.java:4664)
                                                                                                        at android.app.ActivityThread.-$$Nest$mhandleCreateService(Unknown Source:0)
                                                                                                        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2264)
                                                                                                        at android.os.Handler.dispatchMessage(Handler.java:106)
                                                                                                        at android.os.Looper.loopOnce(Looper.java:205)
                                                                                                        at android.os.Looper.loop(Looper.java:294)
                                                                                                        at android.app.ActivityThread.main(ActivityThread.java:8177)
                                                                                                        at java.lang.reflect.Method.invoke(Native Method)
                                                                                                        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
                                                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)

Caused by: java.lang.SecurityException: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts
PavlosTze commented 11 months ago

We also have the exact same issue. Based on this, the fix should be really simple. We need a fix asap for this as its affecting our production apps.

PavlosTze commented 11 months ago

@sylwester-zielinski When can we expect a new version of the library to use in our apps?

sylwester-zielinski commented 11 months ago

I need to release dependency libraries. Maybe today if there were no issues.

sylwester-zielinski commented 11 months ago

@PavlosTze Version 2.3.2 should be already available.

PavlosTze commented 11 months ago

@sylwester-zielinski I get the following:

   > Could not find no.nordicsemi.android:dfu:2.3.2.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/no/nordicsemi/android/dfu/2.3.2/dfu-2.3.2.pom
       - https://repo.maven.apache.org/maven2/no/nordicsemi/android/dfu/2.3.2/dfu-2.3.2.pom
       - https://api.mapbox.com/downloads/v2/releases/maven/no/nordicsemi/android/dfu/2.3.2/dfu-2.3.2.pom
       - https://jitpack.io/no/nordicsemi/android/dfu/2.3.2/dfu-2.3.2.pom

Maybe it's not uploaded yet?

roshanrajaratnam commented 11 months ago

@PavlosTze it might take a couple of hours till its available via mavenCentral. You can include the library directly in your source code so that you can get going.

PavlosTze commented 11 months ago

@roshanrajaratnam @sylwester-zielinski Still not there one day later. We want to include it directly via mavenCentral.

roshanrajaratnam commented 11 months ago

@PavlosTze just noticed that the staging hasn't completed properly. Give it a an hour or so and it should be available. Sorry for any inconvenience.

vasim1422 commented 11 months ago

@PavlosTze Still not working for Device Android 14 please help one this

philips77 commented 11 months ago

Have you followed this and this comments?