eclipseprintingandroid-ndk.so

Linking .so file on Eclipse


I'm still new to Android development, so I'm stuck with NDK.

Background: I am trying to connect my app to the printer. For that purpose the vendor gave a sample application which discovers printer and then prints. Right now I am trying to run that sample application but it has a .so file and every time I try to run it gives me this error:

01-01 17:34:59.618: E/AndroidRuntime(5870): java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.xyz.epos2_printer-2/base.apk"],nativeLibraryDirectories=[/data/app/com.xyz.epos2_printer-2/lib/arm, /vendor/lib, /system/lib]]] couldn't find "libepos2.so"

I am using Eclipse not Android Studio (so build.gradle solution won't work for me I suppose). I have searched on this topic but couldn't figure out how to do it.


Solution

  • Check you have added libepos2.so file in your project

    check the screen shot. in folders mentioned in the screen

    Step 2

    Step 3

    Add this in dependency:

    implementation files('libs/ePOSEasySelect.jar')
    implementation files('libs/ePOS2.jar')
    implementation files('libs/armeabi/libeposeasyselect.so')
    implementation files('libs/armeabi/libeposprint.so')
    

    Step 4

    Add this in gradle.properties:

    android.useDeprecatedNdk=true