• 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

· Add your 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

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

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

How can I get project for Eclipse from Unity3D? 1 Answer

Error launching Unity activity in Eclipse 1 Answer

How do I use the Android Library in Unity? 0 Answers

Different approaches to Android plugins 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