我们在我们的android studio项目中使用libmupdf.so来显示PDF。最近,我们添加了此库的64位版本,因为Google希望使用64位兼容的应用。当我调用drawpage()本机函数时,它立即崩溃。
在尝试调试此问题时,我发现如果我以逐步调试模式运行应用程序,则不会发生崩溃。在这种情况下,drawpage()可以正常工作。我已经划分为在调用drawpage()和voila之前增加一些延迟,当应用程序在android studio中运行且没有调试时,它不会崩溃。
try
{
Thread.sleep(100);
i=100;
}
catch(InterruptedException ex)
{
Thread.currentThread().interrupt();
}
gotoPage(page);
drawPage(bm, pageW, pageH, patchX, patchY, patchW, patchH);
但是,一旦我构建了签名发布的apk,上面的代码就会崩溃,就像在drawpage()调用之前没有延迟的情况下一样。崩溃的痕迹如下所示:
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** pid: 0, tid: 0 >>> com.quazarteam.quazar <<< backtrace:
#00 pc 00000000000ff084 /data/app/com.quazarteam.quazar-98zP5dCEViUnVGBEczcqkQ==/lib/arm64/libmupdf.so
#01 pc 00000000000feea0 /data/app/com.quazarteam.quazar-98zP5dCEViUnVGBEczcqkQ==/lib/arm64/libmupdf.so (pdf_process_contents+212)
#02 pc 00000000000cabac /data/app/com.quazarteam.quazar-98zP5dCEViUnVGBEczcqkQ==/lib/arm64/libmupdf.so
#03 pc 00000000000caa18 /data/app/com.quazarteam.quazar-98zP5dCEViUnVGBEczcqkQ==/lib/arm64/libmupdf.so (pdf_run_page_contents+144)
#04 pc 0000000000072b7c /data/app/com.quazarteam.quazar-98zP5dCEViUnVGBEczcqkQ==/lib/arm64/libmupdf.so (fz_run_page_contents+116)
#05 pc 0000000000067d18 /data/app/com.quazarteam.quazar-98zP5dCEViUnVGBEczcqkQ==/lib/arm64/libmupdf.so (Java_com_quazarteamreader_pdfreader_MuPDFCore_drawPage+584)
#06 pc 000000000001c2ec /data/app/com.quazarteam.quazar-98zP5dCEViUnVGBEczcqkQ==/oat/arm64/base.odex (com.quazarteamreader.pdfreader.MuPDFCore.drawPage+204)
#07 pc 0000000000556588 /system/lib64/libart.so (art_quick_invoke_stub+584)
#08 pc 00000000000cf8f4 /system/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200)
#09 pc 000000000027faec /system/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+344)
#10 pc 000000000027ac18 /system/lib64/libart.so (bool art::interpreter::DoCall<true, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+748)
#11 pc 00000000005280b4 /system/lib64/libart.so (MterpInvokeDirectRange+244)
#12 pc 0000000000548f14 /system/lib64/libart.so (ExecuteMterpImpl+15252)
#13 pc 00000000002be8ec /data/app/com.quazarteam.quazar-98zP5dCEViUnVGBEczcqkQ==/oat/arm64/base.vdex (com.quazarteamreader.pdfreader.MuPDFCore.drawPage+164)
#14 pc 00000000002537f8 /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2824432661+488)
#15 pc 00000000002592ec /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
#16 pc 000000000027abfc /system/lib64/libart.so (bool art::interpreter::DoCall<true, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+720)
#17 pc 00000000005288a0 /system/lib64/libart.so (MterpInvokeVirtualQuickRange+420)
#18 pc 000000000054c914 /system/lib64/libart.so (ExecuteMterpImpl+30100)
#19 pc 00000000002c24f2 /data/app/com.quazarteam.quazar-98zP5dCEViUnVGBEczcqkQ==/oat/arm64/base.vdex (com.quazarteamreader.pdfreader.RenderProxy.drawPage+18)
#20 pc 00000000002537f8 /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2824432661+488)
#21 pc 00000000002592ec /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
#22 pc 000000000027abfc /system/lib64/libart.so (bool art::interpreter::DoCall<true, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+720)
#23 pc 00000000005288a0 /system/lib64/libart.so (MterpInvokeVirtualQuickRange+420)
#24 pc 000000000054c914 /system/lib64/libart.so (ExecuteMterpImpl+30100)
#25 pc 00000000002b01e4 /data/app/com.quazarteam.quazar-98zP5dCEViUnVGBEczcqkQ==/oat/arm64/base.vdex (com.quazarteamreader.archive.download.services.CachingRenderTask.doInBackground+172)
#26 pc 00000000002537f8 /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2824432661+488)
#27 pc 00000000002592ec /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
#28 pc 0000000000279ad8 /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+940)
#29 pc 0000000000528584 /system/lib64/libart.so (MterpInvokeVirtualQuick+584)
#30 pc 000000000054c894 /system/lib64/libart.so (ExecuteMterpImpl+29972)
#31 pc 00000000002b011c /data/app/com.quazarteam.quazar-98zP5dCEViUnVGBEczcqkQ==/oat/arm64/base.vdex (com.quazarteamreader.archive.download.services.CachingRenderTask.doInBackground+4)
#32 pc 00000000002537f8 /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2824432661+488)
#33 pc 0000000000515dd4 /system/lib64/libart.so (artQuickToInterpreterBridge+1020)
#34 pc 000000000055f6fc /system/lib64/libart.so (art_quick_to_interpreter_bridge+92)
#35 pc 0000000000bfc1fc /system/framework/arm64/boot-framework.oat (android.os.AsyncTask$2.call+172)
#36 pc 000000000037098c /system/framework/arm64/boot-core-oj.oat (java.util.concurrent.FutureTask.run+204)
#37 pc 00000000003d9754 /system/framework/arm64/boot-core-oj.oat (java.util.concurrent.ThreadPoolExecutor.runWorker+996)
#38 pc 00000000003d64c0 /system/framework/arm64/boot-core-oj.oat (java.util.concurrent.ThreadPoolExecutor$Worker.run+64)
#39 pc 000000000025d128 /system/framework/arm64/boot-core-oj.oat (java.lang.Thread.run+72)
#40 pc 0000000000556588 /system/lib64/libart.so (art_quick_invoke_stub+584)
#41 pc 00000000000cf8f4 /system/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200)
#42 pc 000000000045d29c /system/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104)
#43 pc 000000000045e358 /system/lib64/libart.so (art::InvokeVirtualOrInterfaceWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue*)+424)
#44 pc 00000000004896dc /system/lib64/libart.so (art::Thread::CreateCallback(void*)+1120)
#45 pc 00000000000921c0 /system/lib64/libc.so (__pthread_start(void*)+36)
#46 pc 0000000000023b00 /system/lib64/libc.so (__start_thread+68)
我已经尝试了在构建渐变中使用许多选项,例如minify等,但是它们都没有任何作用。我现在真的迷失了如何做和如何解决它。非常感谢任何建议或建议!