- Posts: 11
- Thank you received: 0
Microsoft Windows Phone 8.1 support ends (13 Jul 2017)
Microsoft has ended support for Windows Phone 8.1
Questions about Android development and PDF
VPageCache.init ArrayIndexOutOfBoundsException
9 years 1 month ago #11972
by spurgeon
VPageCache.init ArrayIndexOutOfBoundsException was created by spurgeon
Since upgrading from RadaeePDF 3.5 to 3.7 (Android), we've seen quite a few crash reports show up in our Google Play Developer Console with the stack trace below. We're using the imported ViewLib project from 3.7. Can you point me in the right direction as to what conditions would make length=0 and index=-1? I looked at decompiled source for VPageCache.init(...) but am having a hard time getting to root causes.
java.lang.ArrayIndexOutOfBoundsException: length=0; index=-1
at com.radaee.view.VPageCache.init(VPageCache.java:172)
at com.radaee.view.VPageCache.<init>(VPageCache.java:130)
at com.radaee.view.VPage.<init>(VPage.java:72)
at com.radaee.view.PDFLayout.vResize(PDFLayout.java:136)
at com.radaee.reader.PDFLayoutView.onSizeChanged(PDFLayoutView.java:406)
at android.view.View.sizeChange(View.java:18112)
at android.view.View.setFrame(View.java:18074)
at android.view.View.layout(View.java:17989)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1080)
at android.view.View.layout(View.java:17993)
at android.view.ViewGroup.layout(ViewGroup.java:5817)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:344)
at android.widget.FrameLayout.onLayout(FrameLayout.java:281)
at android.view.View.layout(View.java:17993)
at android.view.ViewGroup.layout(ViewGroup.java:5817)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1742)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1494)
at android.view.View.layout(View.java:17993)
at android.view.ViewGroup.layout(ViewGroup.java:5817)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:344)
at android.widget.FrameLayout.onLayout(FrameLayout.java:281)
at android.view.View.layout(View.java:17993)
at android.view.ViewGroup.layout(ViewGroup.java:5817)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1742)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1494)
at android.view.View.layout(View.java:17993)
at android.view.ViewGroup.layout(ViewGroup.java:5817)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:344)
at android.widget.FrameLayout.onLayout(FrameLayout.java:281)
at com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow.java:3146)
at android.view.View.layout(View.java:17993)
at android.view.ViewGroup.layout(ViewGroup.java:5817)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2755)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2456)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1524)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7520)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911)
at android.view.Choreographer.doCallbacks(Choreographer.java:686)
at android.view.Choreographer.doFrame(Choreographer.java:622)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7325)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
java.lang.ArrayIndexOutOfBoundsException: length=0; index=-1
at com.radaee.view.VPageCache.init(VPageCache.java:172)
at com.radaee.view.VPageCache.<init>(VPageCache.java:130)
at com.radaee.view.VPage.<init>(VPage.java:72)
at com.radaee.view.PDFLayout.vResize(PDFLayout.java:136)
at com.radaee.reader.PDFLayoutView.onSizeChanged(PDFLayoutView.java:406)
at android.view.View.sizeChange(View.java:18112)
at android.view.View.setFrame(View.java:18074)
at android.view.View.layout(View.java:17989)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1080)
at android.view.View.layout(View.java:17993)
at android.view.ViewGroup.layout(ViewGroup.java:5817)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:344)
at android.widget.FrameLayout.onLayout(FrameLayout.java:281)
at android.view.View.layout(View.java:17993)
at android.view.ViewGroup.layout(ViewGroup.java:5817)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1742)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1494)
at android.view.View.layout(View.java:17993)
at android.view.ViewGroup.layout(ViewGroup.java:5817)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:344)
at android.widget.FrameLayout.onLayout(FrameLayout.java:281)
at android.view.View.layout(View.java:17993)
at android.view.ViewGroup.layout(ViewGroup.java:5817)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1742)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1494)
at android.view.View.layout(View.java:17993)
at android.view.ViewGroup.layout(ViewGroup.java:5817)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:344)
at android.widget.FrameLayout.onLayout(FrameLayout.java:281)
at com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow.java:3146)
at android.view.View.layout(View.java:17993)
at android.view.ViewGroup.layout(ViewGroup.java:5817)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2755)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2456)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1524)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7520)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911)
at android.view.Choreographer.doCallbacks(Choreographer.java:686)
at android.view.Choreographer.doFrame(Choreographer.java:622)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7325)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
9 years 1 month ago - 9 years 1 month ago #11977
by nermeen
Replied by nermeen on topic VPageCache.init ArrayIndexOutOfBoundsException
what conditions would make length=0 and index=-1? -> We're not able to know that, without knowing the steps that produces this issue.
As a workaround: you can add the following condition before m_blks[blocks - 1].size = total - (m_blks[blocks - 1].x);
Note: We recommend that you update to the latest version
3.10C
, a lot of improvements and fixes have been introduced since 3.7
As a workaround: you can add the following condition before m_blks[blocks - 1].size = total - (m_blks[blocks - 1].x);
Code:
if(blocks > 0)
m_blks[blocks - 1].size = total - (m_blks[blocks - 1].x); //line 153
if(blocks > 0)
m_blks[blocks - 1].size = total - (m_blks[blocks - 1].y); //line 172
Last edit: 9 years 1 month ago by nermeen.
9 years 4 weeks ago #11991
by spurgeon
Replied by spurgeon on topic VPageCache.init ArrayIndexOutOfBoundsException
Thanks for the response. I don't have compile access for VPageCache.java (just the .jar), so I can't implement your workaround. Also, I only have crash reports, not a test PDF or user flow that can reproduce the issue, which is why I'm looking for any direction you can give. However, instead of pursuing this further with 3.7, I'll try to update to 3.10c and see if that fixes the issue.
9 years 4 weeks ago #11998
by nermeen
Replied by nermeen on topic VPageCache.init ArrayIndexOutOfBoundsException
This code modification has been integrated into the lib in version
3.11beta4
, that should be made stable by Tomorrow.
9 years 4 weeks ago #12006
by spurgeon
Replied by spurgeon on topic VPageCache.init ArrayIndexOutOfBoundsException
Does "stable by tomorrow" mean that 3.11 will be released and it will no longer in beta? Or, should I go ahead and integrate 3.11beta4 into my project? Thanks.
9 years 4 weeks ago #12007
by nermeen
Replied by nermeen on topic VPageCache.init ArrayIndexOutOfBoundsException
Yes, we are doing the final tests on the latest fixes, and tomorrow we will publish the stable version.
The difference between 3.11beta4 and the 3.11, will be only in the native part, the java part remains the same.
So if you prefere you can start with the integration,
The difference between 3.11beta4 and the 3.11, will be only in the native part, the java part remains the same.
So if you prefere you can start with the integration,
Time to create page: 0.427 seconds