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

TransactionTooLargeException when navigate from apps list to individual app crashes list #45

Open
insiderser opened this issue Jan 23, 2022 · 5 comments
Labels
bug Something isn't working properly

Comments

@insiderser
Copy link

Steps to reproduce

  1. Have a large list of crashes.
  2. Open the Scoop app.
  3. Can see the apps list.
  4. Navigate to the list of crashes of any app.

Expected behavior

Can see the list of crashes of the selected app.

Actual behavior

Crash:

E AndroidRuntime: java.lang.RuntimeException: android.os.TransactionTooLargeException: data parcel size 1094132 bytes
E AndroidRuntime:        at android.app.ActivityClient.activityStopped(ActivityClient.java:87)
E AndroidRuntime:        at android.app.servertransaction.PendingTransactionActions$StopInfo.run(PendingTransactionActions.java:143)
E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java:938)
E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:99)
E AndroidRuntime:        at android.os.Looper.loopOnce(Looper.java:201)
E AndroidRuntime:        at android.os.Looper.loop(Looper.java:288)
E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:7842)
E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
E AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
E AndroidRuntime: Caused by: android.os.TransactionTooLargeException: data parcel size 1094132 bytes
E AndroidRuntime:        at android.os.BinderProxy.transactNative(Native Method)
E AndroidRuntime:        at android.os.BinderProxy.transact(BinderProxy.java:571)
E AndroidRuntime:        at android.app.IActivityClientController$Stub$Proxy.activityStopped(IActivityClientController.java:1315)
E AndroidRuntime:        at android.app.ActivityClient.activityStopped(ActivityClient.java:84)
E AndroidRuntime:        ... 9 more

Reproduction Rate

100%

Workaround

Clear the crashes history.

@TacoTheDank TacoTheDank added the bug Something isn't working properly label Jan 23, 2022
@TacoTheDank
Copy link
Owner

May I ask how many crashes you had collected to cause this, just for curiosity's sake?

@insiderser
Copy link
Author

May I ask how many crashes you had collected to cause this, just for curiosity's sake?

Over 200. Can't say now as I've cleared the history after creating this issue.

@TacoTheDank
Copy link
Owner

Oh geez lol. Yeah perhaps you should've cleaned that up beforehand.

Regardless, I'll need to figure out if I can handle the exception gracefully so the app doesn't straight up crash.

@insiderser
Copy link
Author

This is not a right way to fix this. I'm an Android developer myself.

I see the app is currently saving the whole crashes list in onSaveInstanceState. This "state" has a limit of 512KB in size. It's not really meant to store unbounded lists.

A more correct way would be to use a ViewModel. It would download all crashes when the VM is being initialized. The crashes list would be stored in a variable in VM. Then when the user returns back to MainActivity, it would just observe data from VM. Then you don't need onSaveInstanceState.

I see the app code is quite old. Feel free to ask any questions, I'm happy to help. Maybe I'll be able to contribute something to this app in the future, but I don't have much free time at the moment.

@TacoTheDank
Copy link
Owner

@insiderser Honestly I agree. The app needs to be pretty much fully rewritten to use modern architecture (MVVM, AndroidX Room, etc.). I'm doing pretty much doing the best I can to keep the app functioning well enough for the foreseeable future until I am capable of rewriting the app completely and actually have the time to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working properly
Projects
None yet
Development

No branches or pull requests

2 participants