mastodon / mastodon-android

Official Android app for Mastodon
https://app.joinmastodon.org/android
GNU General Public License v3.0
1.62k stars 248 forks source link

Translating an Auschwitz Memorial post crashes the Android app #834

Closed GiantCrocodile closed 1 week ago

GiantCrocodile commented 2 weeks ago

Hello,

I tried to translate this post from @auschwitzmuseum@mastodon.world:

https://mastodon.world/@auschwitzmuseum/112377279597161102

The Android app is crashing then under Android 14. No error or any indicator shown. It works on a desktop client so it must be something Android-client-specific. Furthermore in case it fails to translate due to some technical error from the DeepL translation API, it should show an error instead of crashing. So there's 2 things to fix:

  1. more robustness (no crash for whatever reason) with a proper error message
  2. Fixing the root cause why this post can't be translated.

Translating other posts does work (mobile and desktop). I'm on troet.cafe instance. Android app version is v2.5.0 (93).

Best Regards,

grishka commented 1 week ago

Can you please provide a crash log?

If you have a computer with the SDK or adb installed: just plug your phone in with USB debugging enabled and run adb logcat | grep AndroidRuntime

If you don't:

  1. Unlock developer settings by tapping "build number" 10 times, it's somewhere in "about this device" in settings, the exact location varies depending on OEM skin
  2. Shortly after the crash, tap "take bug report"
  3. The bug report will be generated in the background. You will receive a notification when it's ready
  4. Send it somewhere to yourself
  5. Unpack the zip archive, open the (huge) text file and search for, for example, FATAL EXCEPTION, copy the stack trace
GiantCrocodile commented 1 week ago

Hi @grishka! Thanks for the detailled procedure, especially if SDK/ADB are not available. I just did this and found this:

05-04 19:55:20.465 10450 17423 17423 E AndroidRuntime: FATAL EXCEPTION: main
05-04 19:55:20.465 10450 17423 17423 E AndroidRuntime: Process: org.joinmastodon.android, PID: 17423
05-04 19:55:20.465 10450 17423 17423 E AndroidRuntime: java.lang.NullPointerException: Attempt to get length of null array
05-04 19:55:20.465 10450 17423 17423 E AndroidRuntime:  at j$.util.DesugarArrays.stream(Unknown Source:0)
05-04 19:55:20.465 10450 17423 17423 E AndroidRuntime:  at org.joinmastodon.android.ui.displayitems.MediaGridStatusDisplayItem$b.v0(SourceFile:28)
05-04 19:55:20.465 10450 17423 17423 E AndroidRuntime:  at org.joinmastodon.android.ui.displayitems.MediaGridStatusDisplayItem$b.b0(SourceFile:3)
05-04 19:55:20.465 10450 17423 17423 E AndroidRuntime:  at l0.b.c0(SourceFile:3)
05-04 19:55:20.465 10450 17423 17423 E AndroidRuntime:  at g1.a0.O1(SourceFile:55)
05-04 19:55:20.465 10450 17423 17423 E AndroidRuntime:  at g1.a0.Q0(SourceFile:1)
05-04 19:55:20.465 10450 17423 17423 E AndroidRuntime:  at g1.a0$f.a(SourceFile:22)
05-04 19:55:20.465 10450 17423 17423 E AndroidRuntime:  at g1.a0$f.onSuccess(SourceFile:3)
05-04 19:55:20.465 10450 17423 17423 E AndroidRuntime:  at f0.a$a.run(SourceFile:12)
05-04 19:55:20.465 10450 17423 17423 E AndroidRuntime:  at android.os.Handler.handleCallback(Handler.java:958)
05-04 19:55:20.465 10450 17423 17423 E AndroidRuntime:  at android.os.Handler.dispatchMessage(Handler.java:99)
05-04 19:55:20.465 10450 17423 17423 E AndroidRuntime:  at android.os.Looper.loopOnce(Looper.java:230)
05-04 19:55:20.465 10450 17423 17423 E AndroidRuntime:  at android.os.Looper.loop(Looper.java:319)
05-04 19:55:20.465 10450 17423 17423 E AndroidRuntime:  at android.app.ActivityThread.main(ActivityThread.java:8919)
05-04 19:55:20.465 10450 17423 17423 E AndroidRuntime:  at java.lang.reflect.Method.invoke(Native Method)
05-04 19:55:20.465 10450 17423 17423 E AndroidRuntime:  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578)
05-04 19:55:20.465 10450 17423 17423 E AndroidRuntime:  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)

Is this enough or could there be further information relevant?

grishka commented 1 week ago

Thank you, yes, this is enough

GiantCrocodile commented 1 week ago

Thanks for the excellent bugfix resolution time!