I had an examples for two so files for one app which is very simple, and I just have tried to do same code on Android Studio 1.1.0. I refer many web sites, so I put my so files on "src/main/jniLis/[arch]/" and run my app. But it was failed. This is error log from ddms.
UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.mdsedu.twolibstatic-2/base.apk"],nativeLibraryDirectories=[/data/app/com.mdsedu.twolibstatic-2/lib/arm, /vendor/lib, /system/lib]]] couldn't find "libtwolib-first.so
This is the part of java code. (It's similar as jni sample "two-lib".)
public void onCreate(Bundle savedInstanceState)
{ ...
System.loadLibrary("twolib-first");
System.loadLibrary("twolib-second");
int sum = nativeAdd(x, y); ...
}
public native int nativeAdd(int x, int y);
This is the Android.mk
include $(CLEAR_VARS)
LOCAL_MODULE := libtwolib-first
LOCAL_SRC_FILES := first.c
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libtwolib-second
LOCAL_SRC_FILES := second.c
LOCAL_SHARED_LIBRARIES := libtwolib-first
include $(BUILD_SHARED_LIBRARY)
I didn't modiify build.gradle file.
I tried to compress lib/[arch]/*.so files and convert to jar files, but it was not working neither.
Would anybody please help me for my two-lib samples on Android Studio? I just started Android Studio a few days ago. please apologize me if I have misunderstood something.