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

Android crash on foregrounding app with expo SDK 50 #38

Open
stevengoldberg opened this issue Jul 9, 2024 · 1 comment
Open

Android crash on foregrounding app with expo SDK 50 #38

stevengoldberg opened this issue Jul 9, 2024 · 1 comment

Comments

@stevengoldberg
Copy link

I've been using this library for awhile on iOS, where it works as expected. I recently built my app for Android and installed it on a Google Pixel 6a running Android 14. On Android, it crashes immediately every time the app is foregrounded after being backgrounded. This is the crash log:

07-07 18:08:42.559 E/AndroidRuntime( 9894): FATAL EXCEPTION: main
07-07 18:08:42.559 E/AndroidRuntime( 9894): Process: com.yungchomsky.phomo.dev, PID: 9894
07-07 18:08:42.559 E/AndroidRuntime( 9894): java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.Window android.app.Activity.getWindow()' on a null object reference
07-07 18:08:42.559 E/AndroidRuntime( 9894): at com.reactnativevolumemanager.VolumeManagerModule.lambda$setupKeyListener$1(VolumeManagerModule.java:90)
07-07 18:08:42.559 E/AndroidRuntime( 9894): at com.reactnativevolumemanager.VolumeManagerModule.$r8$lambda$30rzJyV0GNOXEEl5yx7XsucmwSY(Unknown Source:0)
07-07 18:08:42.559 E/AndroidRuntime( 9894): at com.reactnativevolumemanager.VolumeManagerModule$$ExternalSyntheticLambda2.run(Unknown Source:2)
07-07 18:08:42.559 E/AndroidRuntime( 9894): at android.os.Handler.handleCallback(Handler.java:938)
07-07 18:08:42.559 E/AndroidRuntime( 9894): at android.os.Handler.dispatchMessage(Handler.java:99)
07-07 18:08:42.559 E/AndroidRuntime( 9894): at android.os.Looper.loopOnce(Looper.java:201)
07-07 18:08:42.559 E/AndroidRuntime( 9894): at android.os.Looper.loop(Looper.java:288)
07-07 18:08:42.559 E/AndroidRuntime( 9894): at android.app.ActivityThread.main(ActivityThread.java:7870)
07-07 18:08:42.559 E/AndroidRuntime( 9894): at java.lang.reflect.Method.invoke(Native Method)
07-07 18:08:42.559 E/AndroidRuntime( 9894): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
07-07 18:08:42.559 E/AndroidRuntime( 9894): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)

The crash always occurs when react-native-volume-manager is installed, even if it isn't imported anywhere in my JS. Uninstalling the package and rebuilding resolves the crash.

If I create a brand new expo app with SDK 50 and install nothing but react-native-volume-manager, the crash is reproducible. However, it's not reproducible with a brand new app using SDK 51. I'm not able to update my production app to SDK 51 yet, though.

Any ideas?

@stevengoldberg
Copy link
Author

Whoops, I just noticed that this is the same error as in #32.

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

No branches or pull requests

1 participant