• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
Question by Jonathan-Bro · Jun 21, 2014 at 07:07 AM · androideclipse

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?

Comment

People who like this

0 Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Jonathan-Bro · Jun 21, 2014 at 10:43 PM 0
Share

Downloaded and tried Bluestacks to run the APK and it worked instantly. I guess something was wrong with my Eclipse settings somewhere...

1 Reply

  • Sort: 
avatar image

Answer by seahorsevn · Jun 28, 2014 at 08:24 AM

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.

Comment

People who like this

0 Show 0 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Unity Answers is in Read-Only mode

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta by June 9. Please note, Unity Answers is now in read-only so we can prepare for the final data migration.

For more information and updates, please read our full announcement thread in the Unity Forum.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

LogoQuiz with Unity 1 Answer

Choosing which files to move to Android apk expansion file 0 Answers

Integrating eclipse with unity and get user input in eclipse 1 Answer

how to integrate unity3d in eclipse IDE? 1 Answer

UnsatisfiedLinkError while linking unity android lib project with eclipse project 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges