pozklundw
pozklundw

Reputation: 525

genymotion ARM translation: "…/lib/arm/libndk.so" has unexpected e_machine: 40

Here is full code, when I try android jni sample, I get has unexpected e_machine, the full steps are:

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

Answers (2)

Joseph
Joseph

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

  1. I solved the issue by following steps :

  2. Right click the project name

  3. Choose Options

  4. Choose Build

  5. Choose Android Build

  6. Change the Configuration to Release(Active)

  7. Go to the Advanced tab and add the x86 under Supported ABIs

Upvotes: 0

pozklundw
pozklundw

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:

  • create jni/Application.mk, write "APP_ABI := x86 armeabi armeabi-v7a"
  • ndk-build
  • debug app in genymotion

Upvotes: 5

Related Questions