Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about Android development and PDF
  • Page:
  • 1

TOPIC:

PDF not loaded. Error -1257367552 on Nexus 5 (Android 5.0) 9 years 4 months ago #8143

  • mobile2b
  • mobile2b's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 1
  • Thank you received: 0
We have been using your library with much success. However I just installed it on a Nexus 5 with Android 5.0 and when opening a pdf only a white screen is displayed. When tapping the PDF the app crashes with the following exception:
12-16 12:22:08.526  18299-18299/[myapp.package] E/InputEventReceiver﹕ Exception dispatching input event.
12-16 12:22:08.527  18299-18299/[myapp.package] E/MessageQueue-JNI﹕ Exception in MessageQueue callback: handleReceiveCallback
12-16 12:22:08.528  18299-18299/[myapp.package] E/MessageQueue-JNI﹕ java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.radaee.pdfex.PDFPage.page_need_refresh()' on a null object reference
            at com.radaee.pdfex.PDFViewSingle$SingleGestureListener.onSingleTapUp(PDFViewSingle.java:156)
            at android.view.GestureDetector.onTouchEvent(GestureDetector.java:595)
            at com.radaee.pdfex.PDFViewSingle.viewTouchEvent(PDFViewSingle.java:1081)
            at com.radaee.reader.PDFReader.onTouchEvent(PDFReader.java:190)
            at android.view.View.dispatchTouchEvent(View.java:8388)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)
            at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2314)
            at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1692)
            at android.app.Activity.dispatchTouchEvent(Activity.java:2739)
            at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2275)
            at android.view.View.dispatchPointerEvent(View.java:8578)
            at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4021)
            at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:3887)
            at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3449)
            at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3502)
            at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3468)
            at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3578)
            at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3476)
            at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3635)
            at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3449)
            at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3502)
            at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3468)
            at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3476)
            at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3449)
            at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5701)
            at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5675)
            at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5646)
            at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:5791)
            at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
            at android.os.MessageQueue.nativePollOnce(Native Method)
            at android.os.MessageQueue.next(MessageQueue.java:143)
            at android.os.Looper.loop(Looper.java:122)
            at android.app.ActivityThread.main(ActivityThread.java:5221)
            at java.lang.reflect.Method.invoke(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:372)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
12-16 12:22:08.528  18299-18299/[myapp.package] D/AndroidRuntime﹕ Shutting down VM
12-16 12:22:08.529  18299-18299/[myapp.package] E/AndroidRuntime﹕ FATAL EXCEPTION: main
    Process: [myapp.package], PID: 18299
    java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.radaee.pdfex.PDFPage.page_need_refresh()' on a null object reference
            at com.radaee.pdfex.PDFViewSingle$SingleGestureListener.onSingleTapUp(PDFViewSingle.java:156)
            at android.view.GestureDetector.onTouchEvent(GestureDetector.java:595)
            at com.radaee.pdfex.PDFViewSingle.viewTouchEvent(PDFViewSingle.java:1081)
            at com.radaee.reader.PDFReader.onTouchEvent(PDFReader.java:190)
            at android.view.View.dispatchTouchEvent(View.java:8388)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)
            at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2314)
            at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1692)
            at android.app.Activity.dispatchTouchEvent(Activity.java:2739)
            at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2275)
            at android.view.View.dispatchPointerEvent(View.java:8578)
            at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4021)
            at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:3887)
            at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3449)
            at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3502)
            at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3468)
            at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3578)
            at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3476)
            at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3635)
            at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3449)
            at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3502)
            at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3468)
            at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3476)
            at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3449)
            at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5701)
            at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5675)
            at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5646)
            at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:5791)
            at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
            at android.os.MessageQueue.nativePollOnce(Native Method)
            at android.os.MessageQueue.next(MessageQueue.java:143)
            at android.os.Looper.loop(Looper.java:122)
            at android.app.ActivityThread.main(ActivityThread.java:5221)
            at java.lang.reflect.Method.invoke(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:372)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)

This does not happen on a Nexus 7 with Android 5.0 and a Nexus 7 with Android 4.4 so I do not think it is related to Android 5.0. It also works correctly on a Galaxy Nexus with 4.3 and all other devices I was able to test. Sadly I do not have a Nexus 5 with Android 4.4 to test it on.

I tried upgrading to the latest version of the library but had a lot of problems doing so. I also can't find out what version we are currently using in that project as it is already somewhat older. How can I find out the version of the library? The javadoc in comrade.pdf.Document says "@version 1.1", but it also says the same in version 3.2, so that's not reliable.


I investigated the crash a bit further. First of all, we implemented our own "onSingleTap" in com.radaee.reader.PDFReader method, which doesn't do any annotation handling or similar but just hides and shows the action bar. But that method is not called so it crashes before that.

We changed the com.radaee.reader.PDFReaderAct to take the file path to open as an Intent parameter and open the Document in onCreate of the PDFreaderAct. I looked into it and the fileURL given to the method seems to be correct. I also set a breakpoint in the com.radaee.pdf.Document Open() method. Somehow the native open() call seems to fail. However, the error code returned is none of the documented, but instead it is "-1257367552".

What does this mean? What's happening here and how can I fix it?

Please Log in or Create an account to join the conversation.

PDF not loaded. Error -1257367552 on Nexus 5 (Android 5.0) 9 years 4 months ago #8149

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
seems, you are using very old version.
in new version, Documet.Open like this:
	public int Open( String path, String password )
	{
		if( hand_val == 0 )
		{
			int ret = 0;
			hand_val = open( path, password );
			if( hand_val <= 0 && hand_val >= -10 )//error, condition changed from old version.
			{
				ret = (int)hand_val;
				hand_val = 0;
				page_count = 0;
			}
			else
				page_count = getPageCount(hand_val);
			return ret;
		}
		return 0;
	}
it is the same to OpenStream and OpenMem.
u can just modify old version codes for com.radaee.pdf.Document
or upgrade to last version.

to upgrade last version:
1. merge Global class.
2. replace all other class in com.radaee.pdf.
3. replace PDFVCache, PDFVPage, PDFVThumb, PDFVThread, PDFVFinder, PDFVSel in com.radaee.view
4. merge PDFView classes in com.radaee.view
5. other correct codes.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Powered by Kunena Forum