DImuthuUpe / AndroidPdfViewer

Android view for displaying PDFs rendered with PdfiumAndroid
Apache License 2.0
8.17k stars 1.91k forks source link

3.0.0-beta.5 Crash with JNI DETECTED ERROR IN APPLICATION: java_class == null #602

Open proguru58 opened 6 years ago

proguru58 commented 6 years ago

I am getting the following error in this library. It works fine on debug mode. It fails running with release APK

05-18 11:44:13.994 2746-2780/? A/art: art/runtime/java_vm_ext.cc:410] JNI DETECTED ERROR IN APPLICATION: java_class == null art/runtime/java_vm_ext.cc:410] in call to GetMethodID art/runtime/java_vm_ext.cc:410] from com.shockwave.pdfium.a.a com.shockwave.pdfium.PdfiumCore.nativeGetPageSizeByIndex(long, int, int) art/runtime/java_vm_ext.cc:410] "AsyncTask #5" prio=5 tid=19 Runnable art/runtime/java_vm_ext.cc:410] | group="main" sCount=0 dsCount=0 obj=0x12e412e0 self=0xade9ee00 art/runtime/java_vm_ext.cc:410] | sysTid=2780 nice=10 cgrp=apps/bg_non_interactive sched=0/0 handle=0x9ca72930 art/runtime/java_vm_ext.cc:410] | state=R schedstat=( 225362362 112423375 384 ) utm=15 stm=7 core=3 HZ=100 art/runtime/java_vm_ext.cc:410] | stack=0x9c970000-0x9c972000 stackSize=1038KB art/runtime/java_vm_ext.cc:410] | held mutexes= "mutator lock"(shared held) art/runtime/java_vm_ext.cc:410] native: #00 pc 0037169f /system/lib/libart.so (_ZN3art15DumpNativeStackERNSt3113basic_ostreamIcNS0_11char_traitsIcEEEEiP12BacktraceMapPKcPNS_9ArtMethodEPv+142) art/runtime/java_vm_ext.cc:410] native: #01 pc 00350cd5 /system/lib/libart.so (_ZNK3art6Thread4DumpERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEP12BacktraceMap+160) art/runtime/java_vm_ext.cc:410] native: #02 pc 0025afab /system/lib/libart.so (ZN3art9JavaVMExt8JniAbortEPKcS2+742) art/runtime/java_vm_ext.cc:410] native: #03 pc 0025b703 /system/lib/libart.so (_ZN3art9JavaVMExt9JniAbortFEPKcS2_z+74) art/runtime/java_vm_ext.cc:410] native: #04 pc 00284731 /system/lib/libart.so (_ZN3art3JNI11GetMethodIDEP7_JNIEnvP7jclassPKcS6+672) art/runtime/java_vm_ext.cc:410] native: #05 pc 000076a7 /data/app/com.vesselvanguard.app-1/lib/arm/libjniPdfium.so (_ZN7_JNIEnv11GetMethodIDEP7jclassPKcS3+8) art/runtime/java_vm_ext.cc:410] native: #06 pc 00007db1 /data/app/com.vesselvanguard.app-1/lib/arm/libjniPdfium.so (Java_com_shockwave_pdfium_PdfiumCore_nativeGetPageSizeByIndex+144) art/runtime/java_vm_ext.cc:410] native: #07 pc 0333ed2b /data/app/com.vesselvanguard.app-1/oat/arm/base.odex (Java_com_shockwave_pdfium_PdfiumCore_nativeGetPageSizeByIndexJII+110) art/runtime/java_vm_ext.cc:410] at com.shockwave.pdfium.PdfiumCore.nativeGetPageSizeByIndex(Native method) art/runtime/java_vm_ext.cc:410] at com.shockwave.pdfium.PdfiumCore.b(PdfiumCore.java:249) art/runtime/java_vm_ext.cc:410] - locked <0x04ff4927> (a java.lang.Object) art/runtime/java_vm_ext.cc:410] at com.github.barteksc.pdfviewer.f.b(PdfFile.java:86) art/runtime/java_vm_ext.cc:410] at com.github.barteksc.pdfviewer.f.(PdfFile.java:75) art/runtime/java_vm_ext.cc:410] at com.github.barteksc.pdfviewer.c.a(DecodingAsyncTask.java:51) art/runtime/java_vm_ext.cc:410] at com.github.barteksc.pdfviewer.c.doInBackground(DecodingAsyncTask.java:25) art/runtime/java_vm_ext.cc:410] at android.os.AsyncTask$2.call(AsyncTask.java:295) art/runtime/java_vm_ext.cc:410] at java.util.concurrent.FutureTask.run(FutureTask.java:237) art/runtime/java_vm_ext.cc:410] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) art/runtime/java_vm_ext.cc:410] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) art/runtime/java_vm_ext.cc:410] at java.lang.Thread.run(Thread.java:818) art/runtime/java_vm_ext.cc:410] art/runtime/runtime.cc:368] Runtime aborting... art/runtime/runtime.cc:368]

ZhangPeibin commented 6 years ago

me too 。。

ZhangPeibin commented 6 years ago

@proguru58 你怎么解决的啊

proguru58 commented 6 years ago

@ZhangPeibin I have solved this problem with downgrading android-pdf-viewer in gradle.

compile 'com.github.barteksc:android-pdf-viewer:2.8.2'

ZhangPeibin commented 6 years ago

@proguru58 Thank you very much !!!!

polesapart commented 5 years ago

3.2.0-beta1 seems to be affected as well.

polesapart commented 5 years ago

The work-around seems to add this to proguard-rules.pro: -keep class com.shockwave.**

amuchand47 commented 4 years ago

The work-around seems to add this to proguard-rules.pro: -keep class com.shockwave.**

Still not able to resolve error, getting same error after that. Please help me.