Android: Getting ExceptionInInitializerError after migrating from Eclipse to Android Studio?

263 views
Skip to first unread message

Shirley Gong

unread,
Sep 11, 2014, 1:44:53 PM9/11/14
to pdfne...@googlegroups.com
Q: Could not load PDFNetC/getting java.lang.ExceptionInInitializerError/getting java.lang.UnsatisfiedLinkError after migrating from Eclipse to Android Studio?

A: In Android Studio, there are two ways to include the PDFNetC native library:
1. place the native libraries under "AppModule/src/main/jniLibs" directory
2. if you want to keep the folder structure to be compatible with Eclipse, then specify in build.gradle the location of jni folder:
android.applicationVariants.all { variant ->
    // Since we are keeping the folder structure to be compatible with Eclipse,
    // we need to set the folder where the native libs are stored
    variant.packageApplication.jniFolders = [new File(projectDir, "libs")] as Set
}
See PDFViewCtrlDemo project for example.
Reply all
Reply to author
Forward
0 new messages