Caused by: android.os.TransactionTooLargeException: data parcel size 1105388 bytes
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(BinderProxy.java:526)
at android.app.IActivityTaskManager$Stub$Proxy.startActivity(IActivityTaskManager.java:3884)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1731)
at android.app.Activity.startActivityForResult(Activity.java:5363)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:767)
at android.app.Activity.startActivityForResult(Activity.java:5304)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:754)
at com.kaola.modules.brick.component.BaseActivity.startActivityForResult(BaseActivity.java:486)
at com.kaola.core.center.gaia.RealGaiaInvoker.startActivityForResult(RealGaiaInvoker.java:95)
at com.kaola.core.center.gaia.RealGaiaInvoker.access$600(RealGaiaInvoker.java:27)
at com.kaola.core.center.gaia.RealGaiaInvoker$1.run(RealGaiaInvoker.java:244)
at com.kaola.core.center.gaia.RealGaiaInvoker.invokeActivityForResult(RealGaiaInvoker.java:251)
at com.kaola.core.center.gaia.RealGaiaInvoker.access$200(RealGaiaInvoker.java:27)
at com.kaola.core.center.gaia.RealGaiaInvoker$GaiaAsyncInvoker.run(RealGaiaInvoker.java:172)
at com.kaola.core.center.gaia.GaiaDispatcher.enqueueInvokeSync(GaiaDispatcher.java:39)
at com.kaola.core.center.gaia.RealGaiaInvoker.invokeSync(RealGaiaInvoker.java:87)
at com.kaola.core.center.router.GaiaRouterProxy.start(GaiaRouterProxy.java:56)
at com.kaola.core.center.router.BaseRouter.start(BaseRouter.java:74)
at com.kaola.core.center.router.RouterRequestBuilder.startForResult(RouterRequestBuilder.java:195)
at com.kaola.core.center.router.RouterRequestBuilder.startForResult(RouterRequestBuilder.java:190)
at com.kaola.sku.SkuActivityDispatcher.start(SkuActivityDispatcher.kt:74)
......
问题分析
1.先查看官方文档对 TransactionTooLargeException 的介绍
1
If the arguments or the return value are too large to fit in the transaction buffer, then the call will fail and TransactionTooLargeException will be thrown.
The Binder transaction buffer has a limited fixed size, currently 1Mb, which is shared by all transactions in progress for the process. Consequently this exception can be thrown when there are many transactions in progress even when most of the individual transactions are of moderate size.
Avoid transferring huge arrays of strings or large bitmaps. If possible, try to break up big requests into smaller pieces.
译:避免传递大数据如 strings 或者 bitmaps ,尽可能的将大数据分解成小块。
1
If you are implementing a service, it may help to impose size or complexity contraints on the queries that clients can perform. For example, if the result set could become large, then don't allow the client to request more than a few records at a time. Alternately, instead of returning all of the available data all at once, return the essential information first and make the client ask for additional information later as needed.