libreliodev / android

Android Customizable Reader - Librelio Digital Publishing Suite
www.librelio.com
226 stars 129 forks source link

Trying to buy from a pdf sample sometimes crashes the app #200

Closed libreliodev closed 10 years ago

libreliodev commented 10 years ago

This is related to #39 and #164.

In Eco des Savoie (https://play.google.com/store/apps/details?id=com.sopreda2.eco74&hl=fr), the app crashes when tapping on the buy button of last page of sample files.

cc @intrications

Here is the crash report:

APP_VERSION_CODE=27
APP_VERSION_NAME=1.2.7
ANDROID_VERSION=4.1.2
PHONE_MODEL=GT-P5110
CUSTOM_DATA=
STACK_TRACE=java.lang.RuntimeException: Unable to start activity ComponentInfo{com.sopreda2.eco74/com.librelio.activity.MuPDFActivity}: java.lang.IllegalStateException: java.lang.Exception: Failed to open /data/data/com.sopreda2.eco74/app_librelio/eco1347_74//eco1347_74/eco1347_74_.pdf
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2122)
at android.app.ActivityThread.access$600(ActivityThread.java:140)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1228)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4895)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalStateException: java.lang.Exception: Failed to open /data/data/com.sopreda2.eco74/app_librelio/eco1347_74//eco1347_74/eco1347_74_.pdf
at com.librelio.lib.utils.PDFParser.<init>(PDFParser.java:35)
at com.librelio.activity.MuPDFActivity.openFile(MuPDFActivity.java:614)
at com.librelio.activity.MuPDFActivity.getMuPdfCore(MuPDFActivity.java:178)
at com.librelio.activity.MuPDFActivity.onCreate(MuPDFActivity.java:110)
at android.app.Activity.performCreate(Activity.java:5163)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2061)
... 11 more
Caused by: java.lang.Exception: Failed to open /data/data/com.sopreda2.eco74/app_librelio/eco1347_74//eco1347_74/eco1347_74_.pdf
at com.artifex.mupdf.MuPDFCore.<init>(MuPDFCore.java:76)
at com.librelio.lib.utils.PDFParser.<init>(PDFParser.java:31)
... 17 more
java.lang.IllegalStateException: java.lang.Exception: Failed to open /data/data/com.sopreda2.eco74/app_librelio/eco1347_74//eco1347_74/eco1347_74_.pdf
at com.librelio.lib.utils.PDFParser.<init>(PDFParser.java:35)
at com.librelio.activity.MuPDFActivity.openFile(MuPDFActivity.java:614)
at com.librelio.activity.MuPDFActivity.getMuPdfCore(MuPDFActivity.java:178)
at com.librelio.activity.MuPDFActivity.onCreate(MuPDFActivity.java:110)
at android.app.Activity.performCreate(Activity.java:5163)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2061)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2122)
at android.app.ActivityThread.access$600(ActivityThread.java:140)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1228)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4895)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.Exception: Failed to open /data/data/com.sopreda2.eco74/app_librelio/eco1347_74//eco1347_74/eco1347_74_.pdf
at com.artifex.mupdf.MuPDFCore.<init>(MuPDFCore.java:76)
at com.librelio.lib.utils.PDFParser.<init>(PDFParser.java:31)
... 17 more
java.lang.Exception: Failed to open /data/data/com.sopreda2.eco74/app_librelio/eco1347_74//eco1347_74/eco1347_74_.pdf
at com.artifex.mupdf.MuPDFCore.<init>(MuPDFCore.java:76)
at com.librelio.lib.utils.PDFParser.<init>(PDFParser.java:31)
at com.librelio.activity.MuPDFActivity.openFile(MuPDFActivity.java:614)
at com.librelio.activity.MuPDFActivity.getMuPdfCore(MuPDFActivity.java:178)
at com.librelio.activity.MuPDFActivity.onCreate(MuPDFActivity.java:110)
at android.app.Activity.performCreate(Activity.java:5163)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2061)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2122)
at android.app.ActivityThread.access$600(ActivityThread.java:140)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1228)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4895)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
at dalvik.system.NativeStart.main(Native Method)

LOGCAT=11-22 17:37:32.646 I/System.out( 6112): buffer returned 
11-22 17:37:32.654 I/libmupdf( 6112): Drop page 4
11-22 17:37:32.654 E/libmupdf( 6112): Goto page 10...
11-22 17:37:32.654 I/libmupdf( 6112): Load page 10
11-22 17:37:32.654 E/libmupdf( 6112): error: cannot find page 11
11-22 17:37:32.654 E/libmupdf( 6112): cannot make displaylist from page 10
11-22 17:37:32.654 D/MuPDFCore( 6112): return buy://localhost/eco1347_74/eco1347_74_.pdf
11-22 17:37:32.708 D/dalvikvm( 6112): GC_FOR_ALLOC freed 642K, 23% free 19054K/24519K, paused 54ms, total 54ms
11-22 17:37:32.716 D/MuPDFCore( 6112): drawPage 5
11-22 17:37:32.716 D/MuPDFCore( 6112): canvas: android.graphics.Canvas@426f8378
11-22 17:37:32.716 E/libmupdf( 6112): PageWidth=1305
11-22 17:37:32.716 E/libmupdf( 6112): PageHeight=1684
11-22 17:37:32.716 I/libmupdf( 6112): In native method
11-22 17:37:32.716 I/libmupdf( 6112): Checking format
11-22 17:37:32.716 I/libmupdf( 6112): locking pixels
11-22 17:37:32.716 E/libmupdf( 6112): Rendering page(9)=582x752 patch=[0,0,582,752]
11-22 17:37:33.521 E/libmupdf( 6112): Rendered
11-22 17:37:33.521 D/MuPDFCore( 6112): return mailto:pleinciel@pleinciel-annecy.com
11-22 17:37:33.521 D/MuPDFCore( 6112): return http://www.montblancautomobiles.com
11-22 17:37:33.521 D/MuPDFCore( 6112): return http://www.montblancautomobiles.com
11-22 17:37:33.552 D/dalvikvm( 6112): GC_FOR_ALLOC freed 50K, 16% free 20760K/24519K, paused 29ms, total 30ms
11-22 17:37:33.560 I/dalvikvm-heap( 6112): Grow heap (frag case) to 24.105MB for 3501328-byte allocation
11-22 17:37:33.622 D/dalvikvm( 6112): GC_CONCURRENT freed 11K, 14% free 24167K/27975K, paused 14ms+6ms, total 67ms
11-22 17:37:33.622 D/dalvikvm( 6112): WAIT_FOR_CONCURRENT_GC blocked 53ms
11-22 17:37:33.630 D/dalvikvm( 6112): WAIT_FOR_CONCURRENT_GC blocked 53ms
11-22 17:37:33.630 D/dalvikvm( 6112): WAIT_FOR_CONCURRENT_GC blocked 54ms
11-22 17:37:33.630 D/MuPDFCore( 6112): drawPage 4
11-22 17:37:33.630 D/MuPDFCore( 6112): canvas: android.graphics.Canvas@4279f098
11-22 17:37:33.630 D/bitmap width( 6112): 1164
11-22 17:37:33.677 D/dalvikvm( 6112): GC_FOR_ALLOC freed 2K, 14% free 24166K/27975K, paused 52ms, total 53ms
11-22 17:37:33.685 I/dalvikvm-heap( 6112): Grow heap (frag case) to 25.762MB for 1750672-byte allocation
11-22 17:37:33.732 D/dalvikvm( 6112): GC_FOR_ALLOC freed <1K, 13% free 25876K/29703K, paused 51ms, total 51ms
11-22 17:37:33.732 E/libmupdf( 6112): PageWidth=1304
11-22 17:37:33.732 E/libmupdf( 6112): PageHeight=1684
11-22 17:37:33.732 I/libmupdf( 6112): In native method
11-22 17:37:33.732 I/libmupdf( 6112): Checking format
11-22 17:37:33.732 I/libmupdf( 6112): locking pixels
11-22 17:37:33.732 E/libmupdf( 6112): Rendering page(7)=582x752 patch=[0,0,582,752]
11-22 17:37:34.287 E/libmupdf( 6112): Rendered
11-22 17:37:34.318 D/dalvikvm( 6112): GC_FOR_ALLOC freed 1727K, 19% free 24171K/29703K, paused 24ms, total 25ms
11-22 17:37:34.318 E/libmupdf( 6112): PageWidth=1304
11-22 17:37:34.318 E/libmupdf( 6112): PageHeight=1684
11-22 17:37:34.318 I/libmupdf( 6112): In native method
11-22 17:37:34.318 I/libmupdf( 6112): Checking format
11-22 17:37:34.318 I/libmupdf( 6112): locking pixels
11-22 17:37:34.318 E/libmupdf( 6112): Rendering page(8)=582x752 patch=[0,0,582,752]
11-22 17:37:34.505 E/libmupdf( 6112): Rendered
11-22 17:37:35.068 D/ReaderView( 6112): onTouchEvent
11-22 17:37:35.068 D/ReaderView( 6112): event.getActionMasked() == MotionEvent.ACTION_DOWN
11-22 17:37:35.122 D/ReaderView( 6112): onTouchEvent
11-22 17:37:35.122 D/ReaderView( 6112): event.getActionMasked() == MotionEvent.ACTION_UP
11-22 17:37:35.122 D/ReaderView( 6112): SLIDE
11-22 17:37:35.365 I/libmupdf( 6112): Drop page 10
11-22 17:37:35.365 E/libmupdf( 6112): Goto page 10...
11-22 17:37:35.365 I/libmupdf( 6112): Load page 10
11-22 17:37:35.365 E/libmupdf( 6112): error: cannot find page 11
11-22 17:37:35.365 E/libmupdf( 6112): cannot make displaylist from page 10
11-22 17:37:35.365 D/MuPDFCore( 6112): return buy://localhost/eco1347_74/eco1347_74_.pdf
11-22 17:37:35.365 I/libmupdf( 6112): Drop page 10
11-22 17:37:35.365 E/libmupdf( 6112): Goto page 10...
11-22 17:37:35.365 I/libmupdf( 6112): Load page 10
11-22 17:37:35.365 E/libmupdf( 6112): error: cannot find page 11
11-22 17:37:35.365 E/libmupdf( 6112): cannot make displaylist from page 10
11-22 17:37:35.365 D/MuPDFCore( 6112): return buy://localhost/eco1347_74/eco1347_74_.pdf
11-22 17:37:35.419 D/DocumentReaderView( 6112): !openLink buy://localhost/eco1347_74/eco1347_74_.pdf
11-22 17:37:35.419 D/MuPDFActivity( 6112): onBuy event path = eco1347_74/eco1347_74_.pdf
11-22 17:37:35.497 D/MuPDFActivity( 6112): Trying to open /data/data/com.sopreda2.eco74/app_librelio/eco1347_74//eco1347_74/eco1347_74_.pdf
11-22 17:37:35.497 E/libmupdf( 6112): Opening document...
11-22 17:37:35.497 E/libmupdf( 6112): error: cannot open /data/data/com.sopreda2.eco74/app_librelio/eco1347_74//eco1347_74/eco1347_74_.pdf
11-22 17:37:35.497 E/libmupdf( 6112): error: cannot load document '/data/data/com.sopreda2.eco74/app_librelio/eco1347_74//eco1347_74/eco1347_74_.pdf'
11-22 17:37:35.497 E/libmupdf( 6112): error: Cannot open document: '/data/data/com.sopreda2.eco74/app_librelio/eco1347_74//eco1347_74/eco1347_74_.pdf'
11-22 17:37:35.497 E/libmupdf( 6112): Failed: Cannot open document: '/data/data/com.sopreda2.eco74/app_librelio/eco1347_74//eco1347_74/eco1347_74_.pdf'
11-22 17:37:35.497 W/System.err( 6112): java.lang.Exception: Failed to open /data/data/com.sopreda2.eco74/app_librelio/eco1347_74//eco1347_74/eco1347_74_.pdf
11-22 17:37:35.513 W/System.err( 6112): at com.artifex.mupdf.MuPDFCore.<init>(MuPDFCore.java:76)
11-22 17:37:35.513 W/System.err( 6112): at com.librelio.lib.utils.PDFParser.<init>(PDFParser.java:31)
11-22 17:37:35.513 W/System.err( 6112): at com.librelio.activity.MuPDFActivity.openFile(MuPDFActivity.java:614)
11-22 17:37:35.513 W/System.err( 6112): at com.librelio.activity.MuPDFActivity.getMuPdfCore(MuPDFActivity.java:178)
11-22 17:37:35.513 W/System.err( 6112): at com.librelio.activity.MuPDFActivity.onCreate(MuPDFActivity.java:110)
11-22 17:37:35.513 W/System.err( 6112): at android.app.Activity.performCreate(Activity.java:5163)
11-22 17:37:35.513 W/System.err( 6112): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
11-22 17:37:35.513 W/System.err( 6112): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2061)
11-22 17:37:35.513 W/System.err( 6112): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2122)
11-22 17:37:35.513 W/System.err( 6112): at android.app.ActivityThread.access$600(ActivityThread.java:140)
11-22 17:37:35.513 W/System.err( 6112): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1228)
11-22 17:37:35.513 W/System.err( 6112): at android.os.Handler.dispatchMessage(Handler.java:99)
11-22 17:37:35.513 W/System.err( 6112): at android.os.Looper.loop(Looper.java:137)
11-22 17:37:35.513 W/System.err( 6112): at android.app.ActivityThread.main(ActivityThread.java:4895)
11-22 17:37:35.513 W/System.err( 6112): at java.lang.reflect.Method.invokeNative(Native Method)
11-22 17:37:35.513 W/System.err( 6112): at java.lang.reflect.Method.invoke(Method.java:511)
11-22 17:37:35.513 W/System.err( 6112): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
11-22 17:37:35.513 W/System.err( 6112): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
11-22 17:37:35.513 W/System.err( 6112): at dalvik.system.NativeStart.main(Native Method)
11-22 17:37:35.521 D/AndroidRuntime( 6112): Shutting down VM
11-22 17:37:35.521 W/dalvikvm( 6112): threadid=1: thread exiting with uncaught exception (group=0x417842a0)
11-22 17:37:35.521 W/GAV2    ( 6112): Thread[main,5,main]: dispatch call queued.  Need to call GAServiceManager.getInstance().initialize().
11-22 17:37:35.521 E/ACRA    ( 6112): ACRA caught a RuntimeException exception for com.sopreda2.eco74. Building report.
11-22 17:37:35.529 D/ACRA    ( 6112): Using custom Report Fields
11-22 17:37:35.591 I/ACRA    ( 6112): READ_LOGS granted! ACRA can include LogCat and DropBox data.
11-22 17:37:35.677 D/dalvikvm( 6112): GC_CONCURRENT freed 1901K, 19% free 24271K/29703K, paused 14ms+27ms, total 142ms
11-22 17:37:35.701 D/ACRA    ( 6112): Retrieving logcat output...
intrications commented 10 years ago

The error appears to be "Failed to open /data/data/com.sopreda2.eco74/app_librelio/eco1349_74//eco1349_74/eco134974.pdf"

The app claims to crash but actually still opens the buy dialog. The bit that is crashing is the Activity that displays pdfs.

For some reason the app is trying to open a pdf when clicking the buy button. Are there two links embedding in that page?

libreliodev commented 10 years ago

@intrications Thanks for looking into this. I don't think there are 2 links on this page.

intrications commented 10 years ago

This should now be fixed.

intrications commented 10 years ago

I think it was broken by the fix for #187.