Skip to content
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 #699

Closed
danpe opened this issue Oct 31, 2023 · 0 comments · Fixed by #700

Comments

@danpe
Copy link
Contributor

danpe commented Oct 31, 2023

Newly introduced behavior changes in Android 14 causes Maverick to crash the app.

image

... 75 more
Caused by: java.lang.SecurityException: com.app: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts
at android.os.Parcel.createExceptionOrNull(Parcel.java:3057)
at android.os.Parcel.createException(Parcel.java:3041)
at android.os.Parcel.readException(Parcel.java:3024)
at android.os.Parcel.readException(Parcel.java:2966)
at android.app.IActivityManager$Stub$Proxy.registerReceiverWithFeature(IActivityManager.java:5684)
at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1852)
at android.app.ContextImpl.registerReceiver(ContextImpl.java:1792)
at android.app.ContextImpl.registerReceiver(ContextImpl.java:1780)
at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:755)
at com.airbnb.mvrx.mocking.printer.MavericksPrintStateBroadcastReceiver.register(MavericksMockPrinter.kt:207)
at com.airbnb.mvrx.mocking.MockMavericksViewModelConfigFactory.buildConfig(MockableMavericksViewModelConfig.kt:273)
at com.airbnb.mvrx.MavericksViewModelConfigFactory.provideConfig$mvrx_release(MavericksViewModelConfigFactory.kt:67)
at com.airbnb.mvrx.MavericksViewModel.(MavericksViewModel.kt:35)
at com.airbnb.mvrx.MavericksViewModel.(MavericksViewModel.kt:25)

This happens due to the following line:

context.registerReceiver(this, IntentFilter(ACTION_COPY_MAVERICKS_STATE))

elihart pushed a commit that referenced this issue Nov 3, 2023
* Update MavericksMockPrinter.kt

* Fixing java.lang.SecurityException

By adding Context.RECEIVER_NOT_EXPORTED
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant