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

Solution for android app crashes when file too big #13

Closed
FREEZX opened this issue Sep 22, 2019 · 2 comments
Closed

Solution for android app crashes when file too big #13

FREEZX opened this issue Sep 22, 2019 · 2 comments

Comments

@FREEZX
Copy link
Contributor

FREEZX commented Sep 22, 2019

I had issues with the android app crashing once the target app was chosen, with an error like this, even though the target app successfully got the image:

2019-09-22 15:11:26.442 5306-5306/com.ktrajkovski.gifer E/JavaBinder: !!! FAILED BINDER TRANSACTION !!!  (parcel size = 4346876)
...
2019-09-22 15:11:27.822 5306-5306/com.ktrajkovski.gifer E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.ktrajkovski.gifer, PID: 5306
    java.lang.RuntimeException: android.os.TransactionTooLargeException: data parcel size 4346876 bytes
        at android.app.ActivityThread$StopInfo.run(ActivityThread.java:3950)
        at android.os.Handler.handleCallback(Handler.java:790)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6494)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:440)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
     Caused by: android.os.TransactionTooLargeException: data parcel size 4346876 bytes
        at android.os.BinderProxy.transactNative(Native Method)
        at android.os.BinderProxy.transact(Binder.java:764)
        at android.app.IActivityManager$Stub$Proxy.activityStopped(IActivityManager.java:4623)
        at android.app.ActivityThread$StopInfo.run(ActivityThread.java:3934)

Solved it by adding:

  @Override
  public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.clear();
  }

to the main activity.

Hope someone with the same issue finds this useful. Perhaps this should also be added to the readme

@moberwasserlechner
Copy link
Owner

moberwasserlechner commented Sep 22, 2019 via email

@FREEZX FREEZX mentioned this issue Sep 22, 2019
@moberwasserlechner
Copy link
Owner

PR is merged. Thx again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants