I use library class that load libsomething.so , also i make everything same as demo (package name).
I'm follow another instruction that set libs as jniLibs, but still reader.java got "Cannot resolve JNI Function".
sourceSets { main { jni.srcDirs = [] jniLibs.srcDirs = ['libs'] }
}
i have created package name android.hardware.uhf.magic->reader.java
Image - class that provided in .so
System.LoadLibrary("something")
Is there any step that i have missed?
Thank You.
What solved it for me was adding an ndk
section under android.defaultConfig
in my gradle config:
android {
defaultConfig {
+ ndk { abiFilters "armeabi-v7a" }
}
}
I don't know any exact answer for your question.But I will try to give you an Answer.
Because I am Use jniLibs too.
sourceSets.main {
jniLibs.srcDir 'src/main/libs' //set libs as .so's location instead of jni
jni.srcDirs = [] //disable automatic ndk-build call with auto-generated Android.mk file
}
In Your code I think you Used only "libs" , is that your exact jniLibs path..? if not then give the full path. Also add this Line in your gradle.properties
android.useDeprecatedNdk=true
Hope this helps..(:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.