fast4x / RiMusic

A multilingual Android application for streaming music from YouTube Music.
https://rimusic.xyz
GNU General Public License v3.0
1.92k stars 100 forks source link

Crash: java.lang.IllegalStateException #2729

Closed twistios closed 3 weeks ago

twistios commented 1 month ago

Steps to reproduce the bug

Currently it seems like it is a random bug so here you go with the steps.

  1. Play songs in play list
  2. Random stuff happens
  3. Crash

Expected behavior

No Crash.

Actual behavior

Crash with java.lang.IllegalStateException.

Screenshots/Screen recordings

No response

Logs

Details

```` 2024-07-12T23:47:22.010: java.lang.IllegalStateException m2.b.h(SourceFile:6) q2.x.h(SourceFile:6) q2.x.g(SourceFile:34) a.a.M(SourceFile:94) B4.a.m(SourceFile:70) I.l0.g(SourceFile:255) d0.a.d(SourceFile:44) d0.a.g(SourceFile:9) j.g(SourceFile:143) d0.a.d(SourceFile:44) d0.a.g(SourceFile:9) J6.d.j(SourceFile:774) d0.a.j(SourceFile:52) N.T.j(SourceFile:170) d0.a.j(SourceFile:52) V.c.b(SourceFile:150) S.S1.a(SourceFile:113) S.V0.b(SourceFile:22) S.I0.j(SourceFile:214) d0.a.j(SourceFile:52) S.X0.j(SourceFile:234) d0.a.j(SourceFile:52) S.C0.a(SourceFile:52) B.k.j(SourceFile:1288) d0.a.j(SourceFile:52) V.c.b(SourceFile:150) I0.s0.a(SourceFile:395) D.i.j(SourceFile:1726) d0.a.j(SourceFile:52) V.c.b(SourceFile:150) I0.U.a(SourceFile:618) I0.A1.j(SourceFile:242) d0.a.j(SourceFile:52) V.c.a(SourceFile:233) I0.A1.j(SourceFile:213) d0.a.j(SourceFile:52) V.c.N(SourceFile:15) V.p.p(SourceFile:236) V.p.L(SourceFile:32) V.t.w(SourceFile:22) V.r0.t(SourceFile:103) V.p0.b(SourceFile:515) I0.e0.doFrame(SourceFile:7) I0.c0.doFrame(SourceFile:48) android.view.Choreographer$CallbackRecord.run(Choreographer.java:1687) android.view.Choreographer$CallbackRecord.run(Choreographer.java:1698) android.view.Choreographer.doCallbacks(Choreographer.java:1153) android.view.Choreographer.doFrame(Choreographer.java:1069) android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1646) android.os.Handler.handleCallback(Handler.java:958) android.os.Handler.dispatchMessage(Handler.java:99) android.os.Looper.loopOnce(Looper.java:230) android.os.Looper.loop(Looper.java:319) android.app.ActivityThread.main(ActivityThread.java:8919) java.lang.reflect.Method.invoke(Native Method) com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578) com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103) ````

RiMusic version

0.6.43

Android version

14

Additional information

Seems like it did not happen before.

Random means that most of the time songs just play as expected but I got this crash once until now.

twistios commented 1 month ago

I got a second crash, this time the stack trace is very long.

Details

```` 2024-07-13T00:49:54.383: java.lang.IllegalStateException m2.b.h(SourceFile:6) q2.x.h(SourceFile:6) q2.x.g(SourceFile:34) a.a.M(SourceFile:94) M6.u0.p(SourceFile:669) d0.a.e(SourceFile:44) d0.a.p(SourceFile:9) B.p.j(SourceFile:334) d0.a.j(SourceFile:52) V.c.a(SourceFile:233) E.J.b(SourceFile:249) C.l.e(SourceFile:104) E.N.j(SourceFile:417) d0.a.j(SourceFile:52) V.c.a(SourceFile:233) f0.f.f(SourceFile:149) E.o0.f(SourceFile:87) E.J.d(SourceFile:105) B.x.j(SourceFile:1066) d0.a.j(SourceFile:52) B.x.j(SourceFile:820) d0.a.j(SourceFile:52) V.c.N(SourceFile:15) V.p.p(SourceFile:203) V.t.k(SourceFile:32) V.r0.a(SourceFile:44) V.n.a(SourceFile:5) V.n.a(SourceFile:5) V.n.a(SourceFile:5) V.t.l(SourceFile:9) F0.H.i(SourceFile:35) F0.H.h(SourceFile:120) F0.C.M(SourceFile:160) E.V.b(SourceFile:34) C.r.b(SourceFile:21) f6.a.Z(SourceFile:11) C.s.j(SourceFile:593) B.x.j(SourceFile:954) F0.E.g(SourceFile:74) H0.u.b(SourceFile:38) p0.W.i(SourceFile:1) H0.A.b(SourceFile:15) A0.b.a(SourceFile:381) c7.c.z(SourceFile:56) g0.t.a(SourceFile:52) g0.u.c(SourceFile:140) H0.m0.a(SourceFile:3) H0.K.s0(SourceFile:133) H0.K.b(SourceFile:91) B.v.g(SourceFile:256) H0.u.b(SourceFile:38) B.I.i(SourceFile:99) H0.A.b(SourceFile:15) B.I.i(SourceFile:99) H0.A.b(SourceFile:15) A0.b.a(SourceFile:381) c7.c.z(SourceFile:56) g0.t.a(SourceFile:52) g0.u.c(SourceFile:140) H0.m0.a(SourceFile:3) H0.K.s0(SourceFile:133) H0.K.b(SourceFile:91) u.m.g(SourceFile:24) H0.u.b(SourceFile:38) u.C.i(SourceFile:240) H0.A.b(SourceFile:15) p0.p.i(SourceFile:1) H0.A.b(SourceFile:15) B.s0.g(SourceFile:39) F0.y.i(SourceFile:8) H0.A.b(SourceFile:15) A0.b.a(SourceFile:381) c7.c.z(SourceFile:56) g0.t.a(SourceFile:52) g0.u.c(SourceFile:140) H0.m0.a(SourceFile:3) H0.K.s0(SourceFile:133) H0.K.b(SourceFile:91) u.f.g(SourceFile:58) H0.u.b(SourceFile:38) B.Y.i(SourceFile:33) H0.A.b(SourceFile:15) B.I.i(SourceFile:99) H0.A.b(SourceFile:15) A0.b.a(SourceFile:381) c7.c.z(SourceFile:56) g0.t.a(SourceFile:52) g0.u.c(SourceFile:140) H0.m0.a(SourceFile:3) H0.K.s0(SourceFile:133) H0.K.b(SourceFile:91) B.d.g(SourceFile:86) B.g0.g(SourceFile:40) H0.u.b(SourceFile:38) B.I.i(SourceFile:99) H0.A.b(SourceFile:15) A0.b.a(SourceFile:381) c7.c.z(SourceFile:56) g0.t.a(SourceFile:52) g0.u.c(SourceFile:140) H0.m0.a(SourceFile:3) H0.K.s0(SourceFile:133) H0.K.b(SourceFile:91) B.v.g(SourceFile:256) H0.u.b(SourceFile:38) B.I.i(SourceFile:99) H0.A.b(SourceFile:15) B.b0.i(SourceFile:115) H0.A.b(SourceFile:15) A0.b.a(SourceFile:381) c7.c.z(SourceFile:56) g0.t.a(SourceFile:52) g0.u.c(SourceFile:140) H0.m0.a(SourceFile:3) H0.K.s0(SourceFile:133) H0.K.b(SourceFile:91) M6.N.j(SourceFile:949) F0.E.g(SourceFile:74) H0.u.b(SourceFile:38) A0.b.a(SourceFile:381) c7.c.z(SourceFile:114) g0.t.a(SourceFile:52) g0.u.c(SourceFile:140) H0.m0.a(SourceFile:3) H0.K.s0(SourceFile:133) H0.F.M(SourceFile:17) H0.F.N(SourceFile:18) H0.T.c(SourceFile:8) H0.T.m(SourceFile:138) H0.T.j(SourceFile:90) I0.y.w(SourceFile:36) I0.y.dispatchDraw(SourceFile:17) android.view.View.draw(View.java:25180) android.view.View.updateDisplayListIfDirty(View.java:24036) android.view.View.draw(View.java:24907) android.view.ViewGroup.drawChild(ViewGroup.java:4780) android.view.ViewGroup.dispatchDraw(ViewGroup.java:4538) android.view.View.updateDisplayListIfDirty(View.java:24022) android.view.View.draw(View.java:24907) android.view.ViewGroup.drawChild(ViewGroup.java:4780) android.view.ViewGroup.dispatchDraw(ViewGroup.java:4538) android.view.View.updateDisplayListIfDirty(View.java:24022) android.view.View.draw(View.java:24907) android.view.ViewGroup.drawChild(ViewGroup.java:4780) android.view.ViewGroup.dispatchDraw(ViewGroup.java:4538) android.view.View.updateDisplayListIfDirty(View.java:24022) android.view.View.draw(View.java:24907) android.view.ViewGroup.drawChild(ViewGroup.java:4780) android.view.ViewGroup.dispatchDraw(ViewGroup.java:4538) android.view.View.updateDisplayListIfDirty(View.java:24022) android.view.View.draw(View.java:24907) android.view.ViewGroup.drawChild(ViewGroup.java:4780) android.view.ViewGroup.dispatchDraw(ViewGroup.java:4538) android.view.View.updateDisplayListIfDirty(View.java:24022) android.view.View.draw(View.java:24907) android.view.ViewGroup.drawChild(ViewGroup.java:4780) android.view.ViewGroup.dispatchDraw(ViewGroup.java:4538) com.android.internal.policy.DecorView.dispatchDraw(DecorView.java:1179) android.view.View.draw(View.java:25180) com.android.internal.policy.DecorView.draw(DecorView.java:1161) android.view.View.updateDisplayListIfDirty(View.java:24036) android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:768) android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:774) android.view.ThreadedRenderer.draw(ThreadedRenderer.java:872) android.view.ViewRootImpl.draw(ViewRootImpl.java:6051) android.view.ViewRootImpl.performDraw(ViewRootImpl.java:5706) android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:4795) android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:3288) android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:11344) android.view.Choreographer$CallbackRecord.run(Choreographer.java:1689) android.view.Choreographer$CallbackRecord.run(Choreographer.java:1698) android.view.Choreographer.doCallbacks(Choreographer.java:1153) android.view.Choreographer.doFrame(Choreographer.java:1079) android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1646) android.os.Handler.handleCallback(Handler.java:958) android.os.Handler.dispatchMessage(Handler.java:99) android.os.Looper.loopOnce(Looper.java:230) android.os.Looper.loop(Looper.java:319) android.app.ActivityThread.main(ActivityThread.java:8919) java.lang.reflect.Method.invoke(Native Method) com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578) com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103) ````

fast4x commented 1 month ago

Please download, try new custom version and send new log. https://github.com/fast4x/RiMusic/tree/master/customVersion

twistios commented 1 month ago

New log with customVersion.

Details

```` 2024-07-13T17:46:29.935: java.lang.IllegalStateException m2.b.h(SourceFile:6) q2.x.h(SourceFile:6) q2.x.g(SourceFile:34) a.a.M(SourceFile:94) M6.u0.p(SourceFile:669) d0.a.e(SourceFile:44) d0.a.p(SourceFile:9) B.p.j(SourceFile:378) d0.a.j(SourceFile:52) V.c.a(SourceFile:233) E.J.b(SourceFile:249) C.l.e(SourceFile:104) E.N.j(SourceFile:477) d0.a.j(SourceFile:52) V.c.a(SourceFile:233) f0.f.f(SourceFile:149) E.o0.f(SourceFile:87) E.J.d(SourceFile:105) B.x.j(SourceFile:1066) d0.a.j(SourceFile:52) B.x.j(SourceFile:820) d0.a.j(SourceFile:52) V.c.N(SourceFile:15) V.p.p(SourceFile:203) V.t.k(SourceFile:32) V.r0.a(SourceFile:44) V.n.a(SourceFile:5) V.n.a(SourceFile:5) V.n.a(SourceFile:5) V.t.l(SourceFile:9) F0.H.i(SourceFile:22) F0.H.h(SourceFile:120) F0.C.M(SourceFile:160) E.V.b(SourceFile:34) C.r.b(SourceFile:21) f6.a.Z(SourceFile:25) C.s.j(SourceFile:609) B.x.j(SourceFile:954) F0.E.g(SourceFile:74) H0.u.b(SourceFile:38) p0.W.i(SourceFile:1) H0.A.b(SourceFile:15) A0.b.a(SourceFile:381) c7.c.z(SourceFile:56) g0.t.a(SourceFile:52) g0.u.c(SourceFile:140) H0.m0.a(SourceFile:3) H0.K.s0(SourceFile:133) H0.K.b(SourceFile:91) B.v.g(SourceFile:256) H0.u.b(SourceFile:38) B.I.i(SourceFile:99) H0.A.b(SourceFile:15) B.I.i(SourceFile:99) H0.A.b(SourceFile:15) A0.b.a(SourceFile:381) c7.c.z(SourceFile:56) g0.t.a(SourceFile:52) g0.u.c(SourceFile:140) H0.m0.a(SourceFile:3) H0.K.s0(SourceFile:133) H0.K.b(SourceFile:91) u.m.g(SourceFile:24) H0.u.b(SourceFile:38) u.C.i(SourceFile:240) H0.A.b(SourceFile:15) p0.p.i(SourceFile:1) H0.A.b(SourceFile:15) B.s0.g(SourceFile:39) F0.y.i(SourceFile:8) H0.A.b(SourceFile:15) A0.b.a(SourceFile:381) c7.c.z(SourceFile:56) g0.t.a(SourceFile:52) g0.u.c(SourceFile:140) H0.m0.a(SourceFile:3) H0.K.s0(SourceFile:133) H0.K.b(SourceFile:91) u.f.g(SourceFile:58) H0.u.b(SourceFile:38) B.Y.i(SourceFile:33) H0.A.b(SourceFile:15) B.I.i(SourceFile:99) H0.A.b(SourceFile:15) A0.b.a(SourceFile:381) c7.c.z(SourceFile:56) g0.t.a(SourceFile:52) g0.u.c(SourceFile:140) H0.m0.a(SourceFile:3) H0.K.s0(SourceFile:133) H0.K.b(SourceFile:91) B.d.g(SourceFile:86) B.g0.g(SourceFile:40) H0.u.b(SourceFile:38) B.I.i(SourceFile:99) H0.A.b(SourceFile:15) A0.b.a(SourceFile:381) c7.c.z(SourceFile:56) g0.t.a(SourceFile:52) g0.u.c(SourceFile:140) H0.m0.a(SourceFile:3) H0.K.s0(SourceFile:133) H0.K.b(SourceFile:91) B.v.g(SourceFile:256) H0.u.b(SourceFile:38) B.I.i(SourceFile:99) H0.A.b(SourceFile:15) B.b0.i(SourceFile:115) H0.A.b(SourceFile:15) A0.b.a(SourceFile:381) c7.c.z(SourceFile:56) g0.t.a(SourceFile:52) g0.u.c(SourceFile:140) H0.m0.a(SourceFile:3) H0.K.s0(SourceFile:133) H0.K.b(SourceFile:91) M6.N.j(SourceFile:962) F0.E.g(SourceFile:74) H0.u.b(SourceFile:38) A0.b.a(SourceFile:381) c7.c.z(SourceFile:114) g0.t.a(SourceFile:52) g0.u.c(SourceFile:140) H0.m0.a(SourceFile:3) H0.K.s0(SourceFile:133) H0.F.M(SourceFile:17) H0.F.N(SourceFile:18) H0.T.c(SourceFile:8) H0.T.m(SourceFile:138) H0.T.j(SourceFile:90) I0.y.w(SourceFile:36) I0.y.dispatchDraw(SourceFile:17) android.view.View.draw(View.java:25180) android.view.View.updateDisplayListIfDirty(View.java:24036) android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4764) android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4736) android.view.View.updateDisplayListIfDirty(View.java:23982) android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4764) android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4736) android.view.View.updateDisplayListIfDirty(View.java:23982) android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4764) android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4736) android.view.View.updateDisplayListIfDirty(View.java:23982) android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4764) android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4736) android.view.View.updateDisplayListIfDirty(View.java:23982) android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4764) android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4736) android.view.View.updateDisplayListIfDirty(View.java:23982) android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4764) android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4736) android.view.View.updateDisplayListIfDirty(View.java:23982) android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:768) android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:774) android.view.ThreadedRenderer.draw(ThreadedRenderer.java:872) android.view.ViewRootImpl.draw(ViewRootImpl.java:6051) android.view.ViewRootImpl.performDraw(ViewRootImpl.java:5706) android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:4795) android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:3288) android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:11344) android.view.Choreographer$CallbackRecord.run(Choreographer.java:1689) android.view.Choreographer$CallbackRecord.run(Choreographer.java:1698) android.view.Choreographer.doCallbacks(Choreographer.java:1153) android.view.Choreographer.doFrame(Choreographer.java:1079) android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1646) android.os.Handler.handleCallback(Handler.java:958) android.os.Handler.dispatchMessage(Handler.java:99) android.os.Looper.loopOnce(Looper.java:230) android.os.Looper.loop(Looper.java:319) android.app.ActivityThread.main(ActivityThread.java:8919) java.lang.reflect.Method.invoke(Native Method) com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578) com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103) ````

twistios commented 1 month ago

I some minutes ago got a new IllegalStateException and I also got a video of the situation. It might be that the exception happened shortly before I captured the video. The music stopped playing and then I recorded the video. Again, similar to my new video for #2732, there was no notification. This time it stopped on or after the first song. Then there is a crash when I try to open the app from background after this.

Compared to the video of NullPointerException I changed background to "Match Theme" again (modern black theme, so it is also not dynamic theme).

https://github.com/user-attachments/assets/66084c01-e50e-4b0b-bde9-1c5069e80276

twistios commented 1 month ago

Here is the related crash log. From the log it seems like it happened while the recording.

Details

```` 2024-07-18T13:59:55.814: java.lang.IllegalStateException m2.b.h(SourceFile:6) q2.x.h(SourceFile:6) q2.x.g(SourceFile:34) a.a.M(SourceFile:94) B4.a.m(SourceFile:216) R6.s0.j(SourceFile:72) V.p.N(SourceFile:438) V.p.U(SourceFile:137) V.p.p(SourceFile:244) V.p.L(SourceFile:32) V.t.w(SourceFile:22) V.r0.t(SourceFile:103) V.p0.b(SourceFile:515) I0.e0.doFrame(SourceFile:7) I0.c0.doFrame(SourceFile:48) android.view.Choreographer$CallbackRecord.run(Choreographer.java:1687) android.view.Choreographer$CallbackRecord.run(Choreographer.java:1698) android.view.Choreographer.doCallbacks(Choreographer.java:1153) android.view.Choreographer.doFrame(Choreographer.java:1069) android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1646) android.os.Handler.handleCallback(Handler.java:958) android.os.Handler.dispatchMessage(Handler.java:99) android.os.Looper.loopOnce(Looper.java:230) android.os.Looper.loop(Looper.java:319) android.app.ActivityThread.main(ActivityThread.java:8919) java.lang.reflect.Method.invoke(Native Method) com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578) com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103) ````

fast4x commented 1 month ago

Wait for next release

ALMIGHTY-VC commented 1 month ago

Here is the related crash log. From the log it seems like it happened while the recording.

Details

2024-07-18T13:59:55.814:  java.lang.IllegalStateException
   m2.b.h(SourceFile:6) 
   q2.x.h(SourceFile:6) 
   q2.x.g(SourceFile:34) 
   a.a.M(SourceFile:94) 
   B4.a.m(SourceFile:216) 
   R6.s0.j(SourceFile:72) 
   V.p.N(SourceFile:438) 
   V.p.U(SourceFile:137) 
   V.p.p(SourceFile:244) 
   V.p.L(SourceFile:32) 
   V.t.w(SourceFile:22) 
   V.r0.t(SourceFile:103) 
   V.p0.b(SourceFile:515) 
   I0.e0.doFrame(SourceFile:7) 
   I0.c0.doFrame(SourceFile:48) 
   android.view.Choreographer$CallbackRecord.run(Choreographer.java:1687) 
   android.view.Choreographer$CallbackRecord.run(Choreographer.java:1698) 
   android.view.Choreographer.doCallbacks(Choreographer.java:1153) 
   android.view.Choreographer.doFrame(Choreographer.java:1069) 
   android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1646) 
   android.os.Handler.handleCallback(Handler.java:958) 
   android.os.Handler.dispatchMessage(Handler.java:99) 
   android.os.Looper.loopOnce(Looper.java:230) 
   android.os.Looper.loop(Looper.java:319) 
   android.app.ActivityThread.main(ActivityThread.java:8919) 
   java.lang.reflect.Method.invoke(Native Method) 
   com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578) 
   com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)

The stack trace you've provided indicates an IllegalStateException occurred within your FOSS music app. This exception typically happens when a method has been invoked at an illegal or inappropriate time. Given the complexity of stack traces, especially those involving Android lifecycle methods and UI updates, pinpointing the exact cause requires a careful examination of the trace and understanding the app's flow.

Step-by-Step Thought Process

  1. Identify the Source of the Exception: The topmost relevant lines in the stack trace usually indicate where the exception originated. In this case, the exception seems to start within your own code (m2.b.h(SourceFile:6)), but without specific line numbers or more descriptive method names, we'll need to infer based on common causes.

  2. Common Causes of IllegalStateException in Android Apps:

    • Attempting to perform operations on UI elements before they are fully initialized.
    • Trying to modify UI components from a background thread without using proper mechanisms like runOnUiThread.
    • Accessing resources or services that have been released or not yet initialized.
  3. Review App Lifecycle and Thread Handling: Since the stack trace involves android.view.Choreographer, which is related to rendering frames on the screen, and android.os.Handler, which deals with scheduling tasks, there's a possibility that UI updates are being attempted incorrectly.

  4. Check for Resource Management Issues: Ensure that any resources (like media players, databases, etc.) are managed correctly throughout the app's lifecycle. For instance, releasing resources too early or accessing them after release could lead to this exception.

  5. Debugging Approach:

    • Use logging to pinpoint exactly where the exception occurs. Add log statements around suspicious areas, especially around UI updates and resource management.
    • Utilize breakpoints and debug mode in your IDE to step through the code and inspect variables and states leading up to the exception.

Key Points to Consider

Code Implementation

Without specific code snippets or more details about what each method does, providing a direct code fix isn't feasible. However, here's a general example of ensuring UI updates are performed on the main thread:

runOnUiThread(new Runnable() {
    @Override
    public void run() {
        // Your UI update code here
    }
});

And ensuring resources are managed correctly:

@Override
protected void onDestroy() {
    super.onDestroy();
    // Release resources here
}

Summary

To resolve the IllegalStateException, carefully review the areas of your app related to UI updates, thread handling, and resource management. Utilize logging and debugging tools to pinpoint the exact cause. Ensure that UI updates are performed safely on the main thread and that resources are managed according to the app's lifecycle.

Citations: By Phind ai

twistios commented 3 weeks ago

Another one of this crash with 0.6.47.1 customVersion 2 (I think there is already a new customVersion).

It is a new stack trace. Or maybe actually not, as it seems to be the same methods...

Details

```` 2024-08-14T14:03:06.717: java.lang.IllegalStateException n2.b.h(SourceFile:6) r2.x.h(SourceFile:6) r2.x.g(SourceFile:34) a6.c.E(SourceFile:94) I6.s0.g(SourceFile:124) e0.a.g(SourceFile:52) A6.N.g(SourceFile:691) e0.a.g(SourceFile:52) A6.K0.e(SourceFile:90) e0.a.d(SourceFile:44) e0.a.e(SourceFile:9) T.U1.a(SourceFile:670) A6.L0.g(SourceFile:383) e0.a.g(SourceFile:52) W.c.a(SourceFile:233) a.a.z(SourceFile:298) a.a.A(SourceFile:189) I6.C0.q(SourceFile:312) e0.a.f(SourceFile:44) e0.a.q(SourceFile:9) B.n.g(SourceFile:419) e0.a.g(SourceFile:52) W.c.a(SourceFile:233) E.L.b(SourceFile:248) C.j.e(SourceFile:104) B6.L.g(SourceFile:448) e0.a.g(SourceFile:52) W.c.a(SourceFile:233) g0.f.c(SourceFile:149) E.l0.c(SourceFile:87) E.L.d(SourceFile:105) A6.Y.g(SourceFile:873) e0.a.g(SourceFile:52) A6.Y.g(SourceFile:641) e0.a.g(SourceFile:52) W.c.O(SourceFile:15) W.q.p(SourceFile:203) W.u.k(SourceFile:32) W.u0.a(SourceFile:43) W.n.a(SourceFile:5) W.n.a(SourceFile:5) W.n.a(SourceFile:5) W.u.l(SourceFile:9) G0.H.i(SourceFile:35) G0.H.h(SourceFile:121) G0.C.H(SourceFile:160) E.T.a(SourceFile:34) C.m.b(SourceFile:21) d8.d.l0(SourceFile:25) C.n.g(SourceFile:592) A6.Y.g(SourceFile:758) G0.E.g(SourceFile:74) I0.u.a(SourceFile:38) q0.Y.i(SourceFile:1) I0.A.a(SourceFile:15) B0.b.a(SourceFile:363) e1.c.y(SourceFile:56) h0.t.a(SourceFile:52) h0.u.c(SourceFile:140) I0.m0.a(SourceFile:3) I0.K.s0(SourceFile:133) I0.K.a(SourceFile:91) B.t.g(SourceFile:256) I0.u.a(SourceFile:38) B.D.i(SourceFile:99) I0.A.a(SourceFile:15) B.D.i(SourceFile:99) I0.A.a(SourceFile:15) B0.b.a(SourceFile:363) e1.c.y(SourceFile:56) h0.t.a(SourceFile:52) h0.u.c(SourceFile:140) I0.m0.a(SourceFile:3) I0.K.s0(SourceFile:133) I0.K.a(SourceFile:91) u.m.g(SourceFile:24) I0.u.a(SourceFile:38) u.B.i(SourceFile:240) I0.A.a(SourceFile:15) q0.p.i(SourceFile:1) I0.A.a(SourceFile:15) B.m0.e(SourceFile:37) G0.y.i(SourceFile:8) I0.A.a(SourceFile:15) B0.b.a(SourceFile:363) e1.c.y(SourceFile:56) h0.t.a(SourceFile:52) h0.u.c(SourceFile:140) I0.m0.a(SourceFile:3) I0.K.s0(SourceFile:133) I0.K.a(SourceFile:91) u.f.g(SourceFile:58) I0.u.a(SourceFile:38) B.S.i(SourceFile:33) I0.A.a(SourceFile:15) B.D.i(SourceFile:99) I0.A.a(SourceFile:15) B0.b.a(SourceFile:363) e1.c.y(SourceFile:56) h0.t.a(SourceFile:52) h0.u.c(SourceFile:140) I0.m0.a(SourceFile:3) I0.K.s0(SourceFile:133) I0.K.a(SourceFile:91) B.d.g(SourceFile:86) B.a0.g(SourceFile:40) I0.u.a(SourceFile:38) B.D.i(SourceFile:99) I0.A.a(SourceFile:15) B0.b.a(SourceFile:363) e1.c.y(SourceFile:56) h0.t.a(SourceFile:52) h0.u.c(SourceFile:140) I0.m0.a(SourceFile:3) I0.K.s0(SourceFile:133) I0.K.a(SourceFile:91) B.t.g(SourceFile:256) I0.u.a(SourceFile:38) B.D.i(SourceFile:99) I0.A.a(SourceFile:15) B.V.i(SourceFile:115) I0.A.a(SourceFile:15) B0.b.a(SourceFile:363) e1.c.y(SourceFile:56) h0.t.a(SourceFile:52) h0.u.c(SourceFile:140) I0.m0.a(SourceFile:3) I0.K.s0(SourceFile:133) I0.K.a(SourceFile:91) I6.O.g(SourceFile:962) G0.E.g(SourceFile:74) I0.u.a(SourceFile:38) B0.b.a(SourceFile:363) e1.c.y(SourceFile:114) h0.t.a(SourceFile:52) h0.u.c(SourceFile:140) I0.m0.a(SourceFile:3) I0.K.s0(SourceFile:133) I0.F.N(SourceFile:17) I0.F.O(SourceFile:18) I0.T.c(SourceFile:8) I0.T.m(SourceFile:138) I0.T.j(SourceFile:90) J0.w.v(SourceFile:36) J0.w.dispatchDraw(SourceFile:17) android.view.View.draw(View.java:25180) android.view.View.updateDisplayListIfDirty(View.java:24036) android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4764) android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4736) android.view.View.updateDisplayListIfDirty(View.java:23982) android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4764) android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4736) android.view.View.updateDisplayListIfDirty(View.java:23982) android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4764) android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4736) android.view.View.updateDisplayListIfDirty(View.java:23982) android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4764) android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4736) android.view.View.updateDisplayListIfDirty(View.java:23982) android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4764) android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4736) android.view.View.updateDisplayListIfDirty(View.java:23982) android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4764) android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4736) android.view.View.updateDisplayListIfDirty(View.java:23982) android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:768) android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:774) android.view.ThreadedRenderer.draw(ThreadedRenderer.java:872) android.view.ViewRootImpl.draw(ViewRootImpl.java:6051) android.view.ViewRootImpl.performDraw(ViewRootImpl.java:5706) android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:4795) android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:3288) android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:11344) android.view.Choreographer$CallbackRecord.run(Choreographer.java:1689) android.view.Choreographer$CallbackRecord.run(Choreographer.java:1698) android.view.Choreographer.doCallbacks(Choreographer.java:1153) android.view.Choreographer.doFrame(Choreographer.java:1079) android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1646) android.os.Handler.handleCallback(Handler.java:958) android.os.Handler.dispatchMessage(Handler.java:99) android.os.Looper.loopOnce(Looper.java:230) android.os.Looper.loop(Looper.java:319) android.app.ActivityThread.main(ActivityThread.java:8919) java.lang.reflect.Method.invoke(Native Method) com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578) com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103) ````

fast4x commented 3 weeks ago

not reproduced

twistios commented 3 weeks ago

I know that it might be hard to reproduce also as it does happen only under certain (unknown to me) conditions.