Fatal Exception: java.lang.RuntimeException: Failure from system

Kapil Rajput picture Kapil Rajput · Jan 24, 2017 · Viewed 13.8k times · Source

I am getting this exception on crashlytics report frequently don't know why ?

 Fatal Exception: java.lang.RuntimeException: Failure from system
   at android.app.Instrumentation.execStartActivity(Instrumentation.java:1547)
   at android.app.Activity.startActivityForResult(Activity.java:4283)
   at android.app.Activity.startActivityForResult(Activity.java:4230)
   at android.support.v4.app.FragmentActivity.startActivityForResult(Unknown Source)
   at android.app.Activity.startActivity(Activity.java:4567)
   at android.app.Activity.startActivity(Activity.java:4535)
   at com.app.Register.MainActivity.onClick(Unknown Source)
   at android.view.View.performClick(View.java:5702)
   at android.widget.TextView.performClick(TextView.java:10887)
   at android.view.View$PerformClick.run(View.java:22533)
   at android.os.Handler.handleCallback(Handler.java:739)
   at android.os.Handler.dispatchMessage(Handler.java:95)
   at android.os.Looper.loop(Looper.java:158)
   at android.app.ActivityThread.main(ActivityThread.java:7224)
   at java.lang.reflect.Method.invoke(Method.java)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by android.os.TransactionTooLargeException: data parcel size 8177736 bytes
   at android.os.BinderProxy.transactNative(Binder.java)
   at android.os.BinderProxy.transact(Binder.java:503)
   at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:3130)
   at android.app.Instrumentation.execStartActivity(Instrumentation.java:1540)
   at android.app.Activity.startActivityForResult(Activity.java:4283)
   at android.app.Activity.startActivityForResult(Activity.java:4230)
   at android.support.v4.app.FragmentActivity.startActivityForResult(Unknown Source)
   at android.app.Activity.startActivity(Activity.java:4567)
   at android.app.Activity.startActivity(Activity.java:4535)
   at ca.dailydelivery.driver.Register.AdditionalInfoActivity.onClick(Unknown Source)
   at android.view.View.performClick(View.java:5702)
   at android.widget.TextView.performClick(TextView.java:10887)
   at android.view.View$PerformClick.run(View.java:22533)
   at android.os.Handler.handleCallback(Handler.java:739)
   at android.os.Handler.dispatchMessage(Handler.java:95)
   at android.os.Looper.loop(Looper.java:158)
   at android.app.ActivityThread.main(ActivityThread.java:7224)
   at java.lang.reflect.Method.invoke(Method.java)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

What i am doing in this activity where crash is generated is passing the Intent to capture image from Camera or Gallery.

Code :

 private void captureImage() {
    Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
    intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);
    // start the image capture Intent
    startActivityForResult(intent, CAMERA_CAPTURE_IMAGE_REQUEST_CODE);
}

private void openGallery() {
    Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);
    photoPickerIntent.setType("image/*");
    startActivityForResult(photoPickerIntent, IMAGE_PICK_GALLERY);
}

Please suggest how to resolve this issue. Thanks

Answer

sasikumar picture sasikumar · Jan 24, 2017

Reduce the image size which you have taken from camera then send to other activity.Because when we pass value it have some limitation for transaction.

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.

More details TransactionTooLargeException