-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 #655
Comments
@kirby510 I'm currently facing the same problem when trying to integrate my app with Android 14 - SDK 34 (UPSIDE_DOWN_CAKE) to handle the behavior changes introduced in SDK 34 and wanted to check if there have been any updates or solutions discussed regarding this issue. |
This also breaks something I am working on. The fix should be very simple if the maintainer would consider pull requests... |
Maybe this is a good time to fork this library and fix the issue ourselves? Its been three years since this library saw an update so I would not expect quick movement on this even though its breaking for all users on Android 14 and later. I have taken a look and unfortunately in order to use the updated broadcast receiver registration method, significant changes to the core dependancies (androidX, core android libs 1.9.0+) are required. These changes appear to cause a lot more build problems, so this library needs significant work to make modern Android builds work again. |
@yd-threra-and @charles-hennge Sorry I was just read the comments. I reported the issues on 3 months ago and it was no reply from the library maintainer. I think it could a good time to fork this library and fix it our own, but it's best to credit the library maintainer for his hardwork on the library. To solve this issue, I had switched to other third party library in order to make it work. But will look out again if there is any related issues in the future Android SDK. Thanks a lot for replying on the issues, and it's nice to know you here. :) |
@kirby510 I took a look myself and a fix is going to be pretty time consuming since there are quite a lot of things that need to be updated for a build to work on new enough libraries to make this fix work. May I ask which solution you moved to? |
Sure, as I mentioned in the earlier message I had switched to other third party library. You can try this Android Http Download Manager: https://github.com/coolerfall/Android-HttpDownloadManager |
This commit addresses the compatibility issue with Android 14 (SDK 34) and SDK 33 by ensuring proper registration of broadcast receivers in accordance with the behavior changes introduced in SDK 34. The `PriorityListProcessorImpl` class now registers the receiver with the appropriate export flags based on the target SDK version of the app. This resolves the `SecurityException` and allows seamless integration with SDK 34. Fixes: tonyofrancis#655
Compile SDK Version: 34 (UPSIDE_DOWN_CAKE)
Target SDK Version: 34 (UPSIDE_DOWN_CAKE)
Phone Android API Level: 34 (UPSIDE_DOWN_CAKE)
Fetch Version: 3.1.6
Crash happened at com.tonyodev.fetch2.helper.PriorityListProcessorImpl, line 71:
context.registerReceiver(priorityBackoffResetReceiver, IntentFilter(ACTION_QUEUE_BACKOFF_RESET))
As mentioned in the Android Developers Documentation:
For apps targeting Build.VERSION_CODES.UPSIDE_DOWN_CAKE, either RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED must be specified if the receiver is not being registered for system broadcasts or a SecurityException will be thrown. See registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter, int) to register a receiver with flags.
The text was updated successfully, but these errors were encountered: