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

Crash on Android 14 devices #12

Open
jintoga opened this issue Jul 18, 2024 · 0 comments · May be fixed by #13
Open

Crash on Android 14 devices #12

jintoga opened this issue Jul 18, 2024 · 0 comments · May be fixed by #13

Comments

@jintoga
Copy link

jintoga commented Jul 18, 2024

Hello! I recently increased our app's targetSdk to 34. And the app crashes on devices with 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
at android.os.Parcel.createExceptionOrNull(Parcel.java:3183)
at android.os.Parcel.createException(Parcel.java:3167)
at android.os.Parcel.readException(Parcel.java:3150)
at android.os.Parcel.readException(Parcel.java:3092)
at android.app.IActivityManager$Stub$Proxy.registerReceiverWithFeature(IActivityManager.java:5860)
at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1853)
at android.app.ContextImpl.registerReceiver(ContextImpl.java:1793)
at android.app.ContextImpl.registerReceiver(ContextImpl.java:1781)
at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:757)
at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:757)
at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:757)
at co.nimblehq.recentapps.thumbnailhiding.HardwareKeyWatcher.startWatch(HardwareKeyWatcher.java:37)
at co.nimblehq.recentapps.thumbnailhiding.RecentAppsThumbnailHidingLifecycleTracker.onActivityStarted(RecentAppsThumbnailHidingLifecycleTracker.kt:51)
at android.app.Application.dispatchActivityStarted(Application.java:401)
at android.app.Activity.dispatchActivityStarted(Activity.java:1548)
at android.app.Activity.onStart(Activity.java:2087)

It seems like the problem here is Android 14 requires flag RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED for the registerReceiver method. And class HardwareKeyWatcher doesn't provide such flag in method startWatch()

image
@hyuwah hyuwah linked a pull request Aug 20, 2024 that will close this issue
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