我正在使用 android pdfviewer lib 打开和阅读 pdf,位于:https ://github.com/barteksc/AndroidPdfViewer
但是当我尝试启动 pdf 时出现错误:
E/zygote64:未找到长 com.shockwave.pdfium.PdfiumCore.nativeOpenDocument(int, java.lang.String) 的实现(已尝试 Java_com_shockwave_pdfium_PdfiumCore_nativeOpenDocument 和 Java_com_shockwave_pdfium_PdfiumCore_nativeOpenDocument__ILjava_lang_String_2)
E/PDFView: 加载 pdf 错误 java.lang.UnsatisfiedLinkError: No implementation found for long com.shockwave.pdfium.PdfiumCore.nativeOpenDocument(int, java.lang.String) (试过 Java_com_shockwave_pdfium_PdfiumCore_nativeOpenDocument 和 Java_com_shockwave_pdfium_PdfiumCore_nativeOpenDocument__ILjava_lang_String_2)
我尝试了依赖项的不同实现,但没有一个起作用:
implementation 'com.github.barteksc:pdfium-android:1.9.0'
implementation "com.github.barteksc:android-pdf-viewer:3.2.0-beta.1"
implementation "com.github.barteksc:android-pdf-viewer:2.8.2"
错误在这里找到:
public PdfDocument newDocument(ParcelFileDescriptor fd, String password) throws IOException {
PdfDocument document = new PdfDocument();
document.parcelFileDescriptor = fd;
synchronized (lock) {
document.mNativeDocPtr = nativeOpenDocument(getNumFd(fd), password);
}
return document;
}
库中的函数 nativeOpenDocument 似乎没有加载。
我在 github 上发现了一些话题:https ://github.com/barteksc/AndroidPdfViewer/issues/538 https://github.com/barteksc/PdfiumAndroid/issues/54 https://github.com/mshockwave/ PdfiumAndroid/问题/13
但是没有找到解决方案,正如建议的那样,我尝试更改依赖项,尝试关闭计算机和手机,尝试使缓存无效并重新启动,在模拟器上尝试但没有任何效果。
如果有人可以帮助我,那就太好了?