I have build a static library with the Android ndk.
I now try to use this library in another Android project
//in mainActivity
static
{
System.loadLibrary("MILlib");
}
I got the following error when building the test project
02 17:07:24.890 2785-2785/com.MIL.testlib E/AndroidRuntime: FATAL EXCEPTION: main Process: com.MIL.testlib, PID: 2785 java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/com.MIL.testlib-1/lib/arm/libMILlib.so" has bad ELF magic at java.lang.Runtime.loadLibrary(Runtime.java:371) at java.lang.System.loadLibrary(System.java:989) at com.MIL.testlib.MainActivity.(MainActivity.java:112) at java.lang.reflect.Constructor.newInstance(Native Method) at java.lang.Class.newInstance(Class.java:1650) at android.app.Instrumentation.newActivity(Instrumentation.java:1079) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2640) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2873) at android.app.ActivityThread.access$900(ActivityThread.java:181) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1482) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:6145) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
What is a bad ELF magic number and how to solve it ?