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

[Bug] Crashes on first launch if system language is unsupported #111

Closed
szescxz opened this issue Aug 14, 2023 · 1 comment
Closed

[Bug] Crashes on first launch if system language is unsupported #111

szescxz opened this issue Aug 14, 2023 · 1 comment
Labels

Comments

@szescxz
Copy link

szescxz commented Aug 14, 2023

Describe the bug
App launches with a blank screen.

To Reproduce
Steps to reproduce the behaviour:

  1. Clear data of the app in system settings.
  2. Launch the app with system language set to "Chinese (Simplified)".

A few things to note:

  • It launches if set to "English (United States)".
  • The crash is no longer observed if the in-app "Interface language" is set.

Expected behaviour
N/A

Environment

Screenshots
N/A

Logs

08-14 09:55:07.816 12022 12022 E AndroidRuntime: FATAL EXCEPTION: main
08-14 09:55:07.816 12022 12022 E AndroidRuntime: Process: com.toasterofbread.spmp.debug, PID: 12022
08-14 09:55:07.816 12022 12022 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.toasterofbread.spmp.debug/com.toasterofbread.spmp.MainActivity}: java.lang.ArrayIndexOutOfBoundsException: length=83; index=-1
08-14 09:55:07.816 12022 12022 E AndroidRuntime: 	at android.app.ActivityThread.performLaunchActivity(Unknown Source:697)
08-14 09:55:07.816 12022 12022 E AndroidRuntime: 	at android.app.ActivityThread.handleLaunchActivity(Unknown Source:94)
08-14 09:55:07.816 12022 12022 E AndroidRuntime: 	at android.app.servertransaction.LaunchActivityItem.execute(Unknown Source:12)
08-14 09:55:07.816 12022 12022 E AndroidRuntime: 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(Unknown Source:77)
08-14 09:55:07.816 12022 12022 E AndroidRuntime: 	at android.app.servertransaction.TransactionExecutor.execute(Unknown Source:73)
08-14 09:55:07.816 12022 12022 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(Unknown Source:127)
08-14 09:55:07.816 12022 12022 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Unknown Source:19)
08-14 09:55:07.816 12022 12022 E AndroidRuntime: 	at android.os.Looper.loopOnce(Unknown Source:176)
08-14 09:55:07.816 12022 12022 E AndroidRuntime: 	at android.os.Looper.loop(Unknown Source:76)
08-14 09:55:07.816 12022 12022 E AndroidRuntime: 	at android.app.ActivityThread.main(Unknown Source:138)
08-14 09:55:07.816 12022 12022 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
08-14 09:55:07.816 12022 12022 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(Unknown Source:11)
08-14 09:55:07.816 12022 12022 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(Unknown Source:309)
08-14 09:55:07.816 12022 12022 E AndroidRuntime: Caused by: java.lang.ArrayIndexOutOfBoundsException: length=83; index=-1
08-14 09:55:07.816 12022 12022 E AndroidRuntime: 	at java.util.Arrays$ArrayList.get(Arrays.java:3766)
08-14 09:55:07.816 12022 12022 E AndroidRuntime: 	at SpMp.init(SpMp.kt:98)
08-14 09:55:07.816 12022 12022 E AndroidRuntime: 	at com.toasterofbread.spmp.MainActivity$onCreate$context$1.invoke(MainActivity.kt:53)
08-14 09:55:07.816 12022 12022 E AndroidRuntime: 	at com.toasterofbread.spmp.MainActivity$onCreate$context$1.invoke(MainActivity.kt:52)
08-14 09:55:07.816 12022 12022 E AndroidRuntime: 	at com.toasterofbread.spmp.platform.PlatformContext.<init>(PlatformContext.android.kt:59)
08-14 09:55:07.816 12022 12022 E AndroidRuntime: 	at com.toasterofbread.spmp.MainActivity.onCreate(MainActivity.kt:52)
08-14 09:55:07.816 12022 12022 E AndroidRuntime: 	at android.app.Activity.performCreate(Unknown Source:125)
08-14 09:55:07.816 12022 12022 E AndroidRuntime: 	at android.app.Activity.performCreate(Unknown Source:1)
08-14 09:55:07.816 12022 12022 E AndroidRuntime: 	at android.app.Instrumentation.callActivityOnCreate(Unknown Source:3)
08-14 09:55:07.816 12022 12022 E AndroidRuntime: 	at android.app.ActivityThread.performLaunchActivity(Unknown Source:433)
08-14 09:55:07.816 12022 12022 E AndroidRuntime: 	... 12 more

initResources(LANGUAGES.elementAt(ui_lang), context)

@szescxz szescxz added the Bug label Aug 14, 2023
@szescxz szescxz changed the title [Bug] Crashes on launch if system language is unsupported [Bug] Crashes on first launch if system language is unsupported Aug 14, 2023
@toasterofbread
Copy link
Owner

Thanks! Should be fixed in main.

toasterofbread added a commit that referenced this issue Nov 12, 2023
Add metadata to Media3 MediaItems #103
Rewrite lanugage system (fixes #111)

Fix crash caused by unsaved song album
Fix interrupted playback when starting a radio using the current song
Upgrade NewPipeExtractor version
Restore MediaItemLayout view_more and multiselect button
(Re?)implement artist page view more page
Display title in home feed view more page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants