I received an Eclipse project which I have successfully imported into Android Studio for use. The only problem is that a class in this project calls some function in a .so file that came with the project. I've been unable to call those methods for days now.
The class is pretty basic:
public class Conversions {
private static Conversions mCom=null;
public static Conversions getInstance(){
if(mCom==null){
mCom=new Conversions();
}
return mCom;
}
public native int StdToIso(int itype,byte[] input,byte[] output);
public native int IsoToStd(int itype,byte[] input,byte[] output);
public native int GetDataType(byte[] input);
public native int StdChangeCoord(byte[] input,int size,byte[] output,int dk);
static {
System.loadLibrary("conversions");
}
}
The error message is:
cannot resolve corresponding JNI function ....
No JNI_OnLoad found in /data/app-lib/com.example.fpdemo-1/libfgtitinit.so 0x4cc91c70, skipping init
The native methods are in several .so files located in my:
jniLibs > armeabi > libconversions.so
jniLibs > armeabi > libfgtitinit.so
But for some reason, I can't read the native files. I think it might be a build problem or an environment one. My Gradle build files looks something like this:
android {
compileSdkVersion 17
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "com.example.fpdemo"
minSdkVersion 12
targetSdkVersion 17
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:support-v4:18.0.0'
compile files('libs/fgtitdevice.jar')
}