0

I am working on a App in Kotlin/rxJava and I have been struggling with an error for a while now.

Every time I exit the application I get a popup where it says: “Unfortunately, AppName has stopped.”.

I get this error in the console: java.lang.RuntimeException: android.os.TransactionTooLargeException: data parcel size 896824 bytes**enter code here**

When I use a phone with API 23 or lower the error does not occur, but with 24 and 25 I get the error and the app “crashes” AFTER I have exited the app. And it is getting really annoying, both for me as a developer and of course for the users.

The error happens whenever I try to exit the app in any fashion. If I click on a link that takes me to the browser, add/send a contact person from my App to the contact list on the phone or share via Gmail, Google+, bluetooth, etc. the error occurs. So what happens is that on all of these issues I have to exit the app(press the homebutton) or open another application from the app (contacts, gmail, etc.) and the app crashes.

I can also mention that when I add a person from my app to the phones contact list all the information gets sent, and I am able to add the person.

Does anyone have any clue why this happonds? Feel free to ask me for more details if that is necessary, I have had this bug for a while now and it is very irritating.

Entire error:

04-12 08:46:18.128 23287-23287/com.****.***** E/AndroidRuntime: FATAL EXCEPTION: main
                                                                         Process: com.******.*******, PID: 23287
                                                                         java.lang.RuntimeException: android.os.TransactionTooLargeException: data parcel size 896824 bytes
                                                                             at android.app.ActivityThread$StopInfo.run(ActivityThread.java:3781)
                                                                             at android.os.Handler.handleCallback(Handler.java:751)
                                                                             at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                             at android.os.Looper.loop(Looper.java:154)
                                                                             at android.app.ActivityThread.main(ActivityThread.java:6119)
                                                                             at java.lang.reflect.Method.invoke(Native Method)
                                                                             at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
                                                                             at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
                                                                          Caused by: android.os.TransactionTooLargeException: data parcel size 896824 bytes
                                                                             at android.os.BinderProxy.transactNative(Native Method)
                                                                             at android.os.BinderProxy.transact(Binder.java:615)
                                                                             at android.app.ActivityManagerProxy.activityStopped(ActivityManagerNative.java:3636)
                                                                             at android.app.ActivityThread$StopInfo.run(ActivityThread.java:3773)
                                                                             at android.os.Handler.handleCallback(Handler.java:751) 
                                                                             at android.os.Handler.dispatchMessage(Handler.java:95) 
                                                                             at android.os.Looper.loop(Looper.java:154) 
                                                                             at android.app.ActivityThread.main(ActivityThread.java:6119) 
                                                                             at java.lang.reflect.Method.invoke(Native Method) 
                                                                             at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) 
                                                                             at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) 

1 Answers1

1

This is caused when an Activity's savedInstanceState bundle is too large. You need to check what objects are being retained when onPause is called. I had this exact same problem when I was dealing with Bitmaps. I believe this is actually only an issue on newer versions of Android since it actually throws an exception now instead of just suppressing it.

jburn2712
  • 167
  • 1
  • 7
  • True, although in previous versions of android the problem was always there but was never fully detailed, below android 6.0 you would get an exception like address already in use or something funny – wax911 Jul 26 '17 at 16:22