From 6b74ac75217c7f5914f4696571ff296d61401ad2 Mon Sep 17 00:00:00 2001 From: Steyn Geldenhuys Date: Tue, 24 Oct 2017 08:56:01 +0200 Subject: [PATCH] Added try to native library loading --- src/main/java/com/shockwave/pdfium/PdfiumCore.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/shockwave/pdfium/PdfiumCore.java b/src/main/java/com/shockwave/pdfium/PdfiumCore.java index d250781..d3fc5e5 100644 --- a/src/main/java/com/shockwave/pdfium/PdfiumCore.java +++ b/src/main/java/com/shockwave/pdfium/PdfiumCore.java @@ -16,11 +16,14 @@ public class PdfiumCore { private static final String TAG = PdfiumCore.class.getName(); static { - - System.loadLibrary("modpng"); - System.loadLibrary("modft2"); - System.loadLibrary("modpdfium"); - System.loadLibrary("jniPdfium"); + try { + System.loadLibrary("modpng"); + System.loadLibrary("modft2"); + System.loadLibrary("modpdfium"); + System.loadLibrary("jniPdfium"); + } catch (UnsatisfiedLinkError e) { + Log.e(TAG, "Native libraries failed to load." + e); + } } private native long nativeOpenDocument(int fd, String password);