I have a problem loading some .dll libraries through my android app, in fact there is tons of questions about this issue but not any one of them solves my problem, the following is how I'm trying to implement them:
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
System.loadLibrary("NetSDKDLL"); // this is where I'm getting the Exception
simpleDLL INSTANCE = (simpleDLL) Native.loadLibrary(
("NetSDKDLL"), simpleDLL.class);
}
public interface NetSDKDLL extends StdCallLibrary {
int IP_NET_DVR_RealPlay(NativeLong nLoginId);
}
}
And this is the log:
01-29 12:20:34.407: E/AndroidRuntime(1623): FATAL EXCEPTION: main
01-29 12:20:34.407: E/AndroidRuntime(1623): Process: com.example.removed, PID: 1623
01-29 12:20:34.407: E/AndroidRuntime(1623): java.lang.UnsatisfiedLinkError: Couldn't load NetSDKDLL from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.removed-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.removed-2, /system/lib]]]: findLibrary returned null
01-29 12:20:34.407: E/AndroidRuntime(1623): at java.lang.Runtime.loadLibrary(Runtime.java:358)
01-29 12:20:34.407: E/AndroidRuntime(1623): at java.lang.System.loadLibrary(System.java:526)
01-29 12:20:34.407: E/AndroidRuntime(1623): at com.example.removed.MainActivity.onCreate(MainActivity.java:34)
And to give a clear overview:
1- I've no problem in SDK and it's path is already assigned in eclipse and in System Environments.
2- the dll libraries are placed in a source folder called dll.
3- the dll libraries also placed in libs folder.
4- I'm using the same way in a regular Java app and it works perfectly.
Updates:
new Exception:
02-01 09:18:44.840: E/AndroidRuntime(1145): Caused by: java.lang.UnsatisfiedLinkError: Native library (com/sun/jna/android-i686/libjnidispatch.so) not found in resource path (.)