FolioReader-Android icon indicating copy to clipboard operation
FolioReader-Android copied to clipboard

Clicking the hamburger icon at the top causes the app to crash

Open n0m0r3pa1n opened this issue 8 years ago • 7 comments

This happens on Nexus 5X with Android 7.1. Please tell me how can I help if I have to debug something!

Here is the crash

EDIT: Wow, you guys pass the whole book as a serializable to the next screen everywhere, why not just work with the filePath and read it everywhere you need it? I will surely check this out.

01-26 23:06:10.507 26802-26802/info.chitanka.android E/JavaBinder: !!! FAILED BINDER TRANSACTION !!! (parcel size = 1856584)
01-26 23:06:10.507 26802-26802/info.chitanka.android D/AndroidRuntime: Shutting down VM
01-26 23:06:10.511 26802-26802/info.chitanka.android E/AndroidRuntime: FATAL EXCEPTION: main
Process: info.chitanka.android, PID: 26802
java.lang.RuntimeException: Failure from system
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1525)
at android.app.Activity.startActivityForResult(Activity.java:4225)
at android.support.v4.app.BaseFragmentActivityJB.startActivityForResult(BaseFragmentActivityJB.java:50)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:79)
at android.app.Activity.startActivityForResult(Activity.java:4183)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:859)
at com.folioreader.activity.FolioActivity$2.onClick(FolioActivity.java:150)
at android.view.View.performClick(View.java:5637)
at android.view.View$PerformClick.run(View.java:22429)
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 1856584 bytes
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:615)
at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:3100)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1518)
at android.app.Activity.startActivityForResult(Activity.java:4225)
at android.support.v4.app.BaseFragmentActivityJB.startActivityForResult(BaseFragmentActivityJB.java:50)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:79)
at android.app.Activity.startActivityForResult(Activity.java:4183)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:859)
at com.folioreader.activity.FolioActivity$2.onClick(FolioActivity.java:150)
at android.view.View.performClick(View.java:5637)
at android.view.View$PerformClick.run(View.java:22429)
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)

n0m0r3pa1n avatar Jan 26 '17 21:01 n0m0r3pa1n

Same here. Did you find a solution? Here, it came up with a "TransactionTooLargeException: data parcel size 939344 bytes", which is a pretty low usage. There's something nasty going on here.

adheus avatar Jan 26 '17 21:01 adheus

I will review the lib and make PR probably. It has a good look and feel and some good options so it is worth trying. The problem is that they pass the whole Book object to every screen as a serializable which is huge. Also the lib crashes when rotating the phone ...

n0m0r3pa1n avatar Jan 26 '17 22:01 n0m0r3pa1n

https://github.com/n0m0r3pa1n/FolioReader-Android

  1. The problem was that when calling another activity the previous one wanted to save it's state where the Book serialized variable was so the state was too large - over 3 mb with maximum allowed 1.
  2. I have fixed the TransactionTooLargeException by replacing all usages of the Book serializable with the needed fields like book title & path to it. So every fragment that needs to read a book does it by reading it from the file path.
  3. I also fixed an exception when trying to open a chapter. There was a comparison by the title of the chapter which was null. I made it to use the id.

I will not make a PR because the rotation is still blowing. Still checking that up.

n0m0r3pa1n avatar Jan 27 '17 06:01 n0m0r3pa1n

Thanks.. Yes, book size is getting too large.. Currently we are using EpubReader().readEpub() which reads all the resources. But I think, if we use readEpubLazy() which will only have href. This way we can avoid problem of TransactionTooLarge.. I'm working on it, but since i also have to manage other work, I'm bit slow.. But, it will be fixed soon..

mahavir155 avatar Jan 27 '17 07:01 mahavir155

https://github.com/FolioReader/FolioReader-Android/pull/63 PR is waiting

n0m0r3pa1n avatar Jan 29 '17 14:01 n0m0r3pa1n

hello, any update on this? 0.2.5 still have this issue

eganipad avatar Aug 02 '17 13:08 eganipad

Same error in 0.5.4 version

KishanViramgama avatar Jan 28 '21 05:01 KishanViramgama