Library libpspdfkit Not Found
PSPDFKit has integrated support for ReLinker, which is a robust native library loader for Android. When using Android apps with native libraries (like PSPDFKit does), you’ll occasionally see errors like the following, which are caused by Android’s unreliable PackageManager
implementation:
Caused by: java.lang.UnsatisfiedLinkError: Library libpspdfkit not found at java.lang.Runtime.loadLibrary(Runtime.java:461) at java.lang.System.loadLibrary(System.java:557) at com.example.NativeStuff.<clinit>(Native.java:16) ... 5 more
ReLinker fixes these issues by replacing the standard System.loadLibrary
call with a more reliable implementation. With Gradle, PSPDFKit automatically adds ReLinker as a transitive dependency — no further action is required to make ReLinker work. However, if you’re using manual library integration, you need to add ReLinker to the dependencies
block of your build.gradle
file.
Adding ReLinker
❗Important: This integration is only required if you manually integrate the PSPDFKit
.aar
file. If you used Maven/Gradle for integrating PSPDFKit, ReLinker has already been set up for you.
-
Go to https://github.com/KeepSafe/ReLinker and look for the current version of ReLinker.
-
Inside the
dependencies
block of yourapp/build.gradle
, add the following (replace the version with the current one):dependencies { implementation 'com.getkeepsafe.relinker:relinker:' }
-
Run your app. PSPDFKit will automatically pick up ReLinker and use it.