Can't run Android build in Emulator. "Unable to find native library: main"

After googling for hours, I decided to see if any kind soul could guide me in the right direction. I’m a complete newbie at this, so pardon me if the I’m too detailed. I don’t want to assume anything is correct.

I installed the Android SDK and have the following installed

  • Build-Tools
  • SDK tools
  • 2.3.3 API10
  • (and other unrelated stuff)

I then compiled an Android APK file using Unity 4.5 with “Google Android Project” checked in the build settings window. My bundle identifier which appears to be important for packaging the APK is named: “com.mycompany.swiperpg” and the minimum API is 10 (gingerbread).

It seems Unity made the APK file successfully

Next I open up Eclipse and import the APK to form a new project. I assume the manifest and everything is OK. I press the play button and the Android emulator appears. The log file says it installed the program.

    Uploading swiperpg_nomouse.apk onto device 'emulator-5554'
    Installing swiperpg_nomouse.apk...
    Success!
    Starting activity com.mycompany.swiperpg.UnityPlayerNativeActivity on device emulator-5554
    ActivityManager: WARNING: linker: libdvm.so has text relocations. This is wasting memory and is a security risk. Please fix.
    ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.mycompany.swiperpg/.UnityPlayerNativeActivity }

I then get a wall of errors from logcat

06-20 02:52:53.440: D/dalvikvm(1780): Not late-enabling CheckJNI (already on)
06-20 02:52:53.510: D/AndroidRuntime(1780): Shutting down VM
06-20 02:52:53.510: W/dalvikvm(1780): threadid=1: thread exiting with uncaught exception (group=0xb2d88b20)
06-20 02:52:53.510: E/AndroidRuntime(1780): FATAL EXCEPTION: main
06-20 02:52:53.510: E/AndroidRuntime(1780): Process: com.mycompany.swiperpg, PID: 1780
06-20 02:52:53.510: E/AndroidRuntime(1780): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mycompany.swiperpg/com.mycompany.swiperpg.UnityPlayerNativeActivity}: java.lang.IllegalArgumentException: Unable to find native library: main
06-20 02:52:53.510: E/AndroidRuntime(1780): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
06-20 02:52:53.510: E/AndroidRuntime(1780): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
06-20 02:52:53.510: E/AndroidRuntime(1780): 	at android.app.ActivityThread.access$800(ActivityThread.java:135)
06-20 02:52:53.510: E/AndroidRuntime(1780): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
06-20 02:52:53.510: E/AndroidRuntime(1780): 	at android.os.Handler.dispatchMessage(Handler.java:102)
06-20 02:52:53.510: E/AndroidRuntime(1780): 	at android.os.Looper.loop(Looper.java:136)
06-20 02:52:53.510: E/AndroidRuntime(1780): 	at android.app.ActivityThread.main(ActivityThread.java:5017)
06-20 02:52:53.510: E/AndroidRuntime(1780): 	at java.lang.reflect.Method.invokeNative(Native Method)
06-20 02:52:53.510: E/AndroidRuntime(1780): 	at java.lang.reflect.Method.invoke(Method.java:515)

It looks like the causing error might be

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mycompany.swiperpg/com.mycompany.swiperpg.UnityPlayerNativeActivity}: java.lang.IllegalArgumentException: Unable to find native library: main

Am I missing a step for running this in the emulator?

I got the same problem. I solved by change the emulator device that support ARMv7. Maybe your device that you use is not ARMv7 or you can check on setting > Android > Device Filter. Hope this can help.