Issue
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
Step 2
Add the following in gradle under default config.
ndk { abiFilters "armeabi-v7a", "x86", "armeabi", "mips" }
sourceSets { main { jniLibs.srcDirs = ['src/main/jniLibs/'] } }
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
Answered By - Shyam
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.