Reputation: 525
Here is full code, when I try android jni sample, I get has unexpected e_machine
, the full steps are:
$ /media/roroco/disk750/adr/android-ndk-r10e/ndk-buil
and get following output
Process: com.mamlambo.sample.ndk1, PID: 5560
java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/com.mamlambo.sample.ndk1-1/lib/arm/libndk1.so" has unexpected e_machine: 40
at java.lang.Runtime.loadLibrary(Runtime.java:371)
at java.lang.System.loadLibrary(System.java:988)
at com.mamlambo.sample.ndk1.AndroidNDK1SampleActivity.<clinit>(AndroidNDK1SampleActivity.java:35)
at java.lang.reflect.Constructor.newInstance(Native Method)
at java.lang.Class.newInstance(Class.java:1606)
Upvotes: 4
Views: 8198
Reputation: 6031
Using Visual Studio for Mac i get a similar error when i build the release version of the app and run it on Genymotion with ARM translation. java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/<appname>/lib/arm/libmonodroid.so" has unexpected e_machine: 40
I solved the issue by following steps :
Right click the project name
Choose Options
Choose Build
Choose Android Build
Change the Configuration to Release(Active)
Go to the Advanced tab and add the x86 under Supported ABIs
Upvotes: 0
Reputation: 525
I find the solution, the reason is I use genymotion and install genymotion armtranslation, the armtranslation has bug, so I should build c to x86 device, the steps are:
Upvotes: 5