burhanyaprak
burhanyaprak

Reputation: 184

Error with Receiver Export on API 34: "One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED Should be Specified"

I am developing an Android application and encountered the following error message:

One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts.

This error occurred when I was using com.google.android.play:core:1.10.3. I suspect it's related to how broadcast receivers are registered or managed in the app. Since I use this libraries in app update functions, I can not remove it.

Upvotes: 3

Views: 13964

Answers (2)

burhanyaprak
burhanyaprak

Reputation: 184

With new google updates, they extract in app update from core library. You can remove this

implementation 'com.google.android.play:core:1.10.3'

And add this

implementation 'com.google.android.play:app-update:2.1.0'

After making this change, sync your project with the updated Gradle files. This should resolve the error related to the RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED specification in API 34.

Thanks for @pakman suggestion, you can see the migration details on this official source. here: https://developer.android.com/guide/playcore/in-app-updates/kotlin-java

Upvotes: 3

Akshat kant
Akshat kant

Reputation: 133

The answer given by @burhanyaprak is correct, i was facing the same issue right now, but the solution is not complete, what actually happened is

implementation 'com.google.android.play:core:1.10.3'

is indeed an old library, and according to official docs, this particular library is divided into four seperate library which are

Play Asset Delivery Library

Play Feature Delivery Library

Play In-App Reviews Library

Play In-App Updates Library

All the integration step is Mentioned here from Common migration steps

and you will be good to go.

Upvotes: 0

Related Questions