-
Notifications
You must be signed in to change notification settings - Fork 16
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
Game crashes on certain phones once the gameplay starts #131
Comments
Got the idea from this thread: https://www.badlogicgames.com/forum/viewtopic.php?t=28507
After some digging online, I can't seem to find a viable solution, while the bug persists despite a reimplemented rumble for newer devices. It looks like some phones will not have access to vibrations of haptic feedback at all. In this case, the menu will not even be displayed. To make sure everything is set automatically, upon first launch the game will vibrate shortly and, depending on whether it went well, everything vibration-related will be enabled or disabled. |
It's impossible to tell in advance whether NullPointExceptions will be thrown on one phone. Catching them is the next best thing.
…devices on android 8 and handled deprecated code Apparently occurs on only Samsung android 8 devices and there is no fix for vibrator except catching the exception so that app doesn't crash. https://gitlab.com/juanitobananas/wave-up/-/issues/131 overbound/SonicTimeTwisted#131 https://web.archive.org/web/20201114040257/https://www.badlogicgames.com/forum/viewtopic.php?t=28507 ``` java.lang.NullPointerException: Attempt to read from field 'android.os.VibrationEffect com.android.server.VibratorService$Vibration.mEffect' on a null object reference at android.os.Parcel.readException(Parcel.java:2035) at android.os.Parcel.readException(Parcel.java:1975) at android.os.IVibratorService$Stub$Proxy.vibrate(IVibratorService.java:292) at android.os.SystemVibrator.vibrate(SystemVibrator.java:81) at android.os.Vibrator.vibrate(Vibrator.java:191) at android.os.Vibrator.vibrate(Vibrator.java:110) at android.os.Vibrator.vibrate(Vibrator.java:89) at com.termux.app.terminal.io.BellHandler$1.run(BellHandler.java:37) at com.termux.app.terminal.io.BellHandler.doBell(BellHandler.java:55) at com.termux.app.terminal.TermuxTerminalSessionClient.onBell(TermuxTerminalSessionClient.java:178) at com.termux.terminal.TerminalSession.onBell(TerminalSession.java:278) ```
…devices on android 8 and handled deprecated code Apparently occurs on only Samsung android 8 devices and there is no fix for vibrator except catching the exception so that app doesn't crash. https://gitlab.com/juanitobananas/wave-up/-/issues/131 overbound/SonicTimeTwisted#131 https://web.archive.org/web/20201114040257/https://www.badlogicgames.com/forum/viewtopic.php?t=28507 ``` java.lang.NullPointerException: Attempt to read from field 'android.os.VibrationEffect com.android.server.VibratorService$Vibration.mEffect' on a null object reference at android.os.Parcel.readException(Parcel.java:2035) at android.os.Parcel.readException(Parcel.java:1975) at android.os.IVibratorService$Stub$Proxy.vibrate(IVibratorService.java:292) at android.os.SystemVibrator.vibrate(SystemVibrator.java:81) at android.os.Vibrator.vibrate(Vibrator.java:191) at android.os.Vibrator.vibrate(Vibrator.java:110) at android.os.Vibrator.vibrate(Vibrator.java:89) at com.termux.app.terminal.io.BellHandler$1.run(BellHandler.java:37) at com.termux.app.terminal.io.BellHandler.doBell(BellHandler.java:55) at com.termux.app.terminal.TermuxTerminalSessionClient.onBell(TermuxTerminalSessionClient.java:178) at com.termux.terminal.TerminalSession.onBell(TerminalSession.java:278) ```
…devices on android 8 and handled deprecated code Apparently occurs on only Samsung android 8 devices and there is no fix for vibrator except catching the exception so that app doesn't crash. https://gitlab.com/juanitobananas/wave-up/-/issues/131 overbound/SonicTimeTwisted#131 https://web.archive.org/web/20201114040257/https://www.badlogicgames.com/forum/viewtopic.php?t=28507 ``` java.lang.NullPointerException: Attempt to read from field 'android.os.VibrationEffect com.android.server.VibratorService$Vibration.mEffect' on a null object reference at android.os.Parcel.readException(Parcel.java:2035) at android.os.Parcel.readException(Parcel.java:1975) at android.os.IVibratorService$Stub$Proxy.vibrate(IVibratorService.java:292) at android.os.SystemVibrator.vibrate(SystemVibrator.java:81) at android.os.Vibrator.vibrate(Vibrator.java:191) at android.os.Vibrator.vibrate(Vibrator.java:110) at android.os.Vibrator.vibrate(Vibrator.java:89) at com.termux.app.terminal.io.BellHandler$1.run(BellHandler.java:37) at com.termux.app.terminal.io.BellHandler.doBell(BellHandler.java:55) at com.termux.app.terminal.TermuxTerminalSessionClient.onBell(TermuxTerminalSessionClient.java:178) at com.termux.terminal.TerminalSession.onBell(TerminalSession.java:278) ```
…devices on android 8 and handled deprecated code Apparently occurs on only Samsung android 8 devices and there is no fix for vibrator except catching the exception so that app doesn't crash. https://gitlab.com/juanitobananas/wave-up/-/issues/131 overbound/SonicTimeTwisted#131 https://web.archive.org/web/20201114040257/https://www.badlogicgames.com/forum/viewtopic.php?t=28507 ``` java.lang.NullPointerException: Attempt to read from field 'android.os.VibrationEffect com.android.server.VibratorService$Vibration.mEffect' on a null object reference at android.os.Parcel.readException(Parcel.java:2035) at android.os.Parcel.readException(Parcel.java:1975) at android.os.IVibratorService$Stub$Proxy.vibrate(IVibratorService.java:292) at android.os.SystemVibrator.vibrate(SystemVibrator.java:81) at android.os.Vibrator.vibrate(Vibrator.java:191) at android.os.Vibrator.vibrate(Vibrator.java:110) at android.os.Vibrator.vibrate(Vibrator.java:89) at com.termux.app.terminal.io.BellHandler$1.run(BellHandler.java:37) at com.termux.app.terminal.io.BellHandler.doBell(BellHandler.java:55) at com.termux.app.terminal.TermuxTerminalSessionClient.onBell(TermuxTerminalSessionClient.java:178) at com.termux.terminal.TerminalSession.onBell(TerminalSession.java:278) ```
Reported by @Eukaryot3K :
Upon running the game on a Moto G5 Plus with Android 8.1.0, a few seconds into the game it crashes with the following stack trace:
This seems to be vibration-related, I might have wrongfully assumed that vibration in all phones worked the same
and a Vibrator was guaranteed to exist, which might not be the case.EDIT: It's not the absence of a Vibrator, it's the way I implemented vibrations, completely different.
The text was updated successfully, but these errors were encountered: