PRADEEP TRIVEDI
PRADEEP TRIVEDI

Reputation: 1

App Crash Android 14 : One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specifcation

**> Hello

I am using io.agora.rtc:chat-sdk:1.2.0 for chat in my android application. While running app on Android 14 device app crash and giving me below error:

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 android Can anyone please help me to solve this. Thanks in advance.**

java.lang.SecurityException: com.example: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts android.os.Parcel.createExceptionOrNull(Parcel.java:3071) at android.os.Parcel.createException(Parcel.java:3055) android.os.Parcel.readException(Parcel.java:3038 at android.os.Parcel.readException(Parcel.java:2980 atandroid.app.IActivityManager$Stub$Proxy.registerReceiverWithFeature(IActivityManager.java:6380)

Upvotes: 0

Views: 219

Answers (1)

Justin
Justin

Reputation: 299

RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED is required when registering a broadcast listener for apps targeting android 14 and above.

It should look something like this
context.registerReceiver(broadcastReceiver, intentFilter, RECEIVER_NOT_EXPORTED);

However, it you are not the one registering but a third-party library is then cross check once if you are using the latest version of that library. If there is a new version use that, but if there is no new version then you cannot use that library on apps that target android 14 and above.

Upvotes: 0

Related Questions