Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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
1
Question by dsgermainatlvlstudio-com · Feb 26, 2015 at 02:40 AM · launcherlibraries

Libmain.so - "Unable to find native library: main"

We are developing an Android "launcher" (home screen) using Unity for a custom branded device. This software is "pre-installed". Applications that are pre-installed do not go through the normal installation process where libraries get copied from the APK to the appropriate /data/data directory. Their native libraries are PRE installed as well, but nothing can be pre-installed to /data as that partition is created on 1st system boot, so they are pre-installed to /system/lib.

How to we specify linking parameters under Unity, or manually by tweaking the .APK, to allow us to point to /system/lib ?

We are under time constraint on this issue and would greatly appreciate help resolving it!

Here's the stack trace that we get when pre-installing the Unity application:

The output from the exception: E/AndroidRuntime( 1646): FATAL EXCEPTION: main E/AndroidRuntime( 1646): Process: com.developername.project.componentname, PID: 1646 E/AndroidRuntime( 1646): java.lang.RuntimeException: Unable to start activity ComponentInfo {com.developername.project.componentname/com.developername.project.KidActivity} : java.lang.IllegalArgumentException: Unable to find native library: main E/AndroidRuntime( 1646): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2377) E/AndroidRuntime( 1646): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2429) E/AndroidRuntime( 1646): at android.app.ActivityThread.access$800(ActivityThread.java:151) E/AndroidRuntime( 1646): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1342) E/AndroidRuntime( 1646): at android.os.Handler.dispatchMessage(Handler.java:110) E/AndroidRuntime( 1646): at android.os.Looper.loop(Looper.java:193) E/AndroidRuntime( 1646): at android.app.ActivityThread.main(ActivityThread.java:5341) E/AndroidRuntime( 1646): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 1646): at java.lang.reflect.Method.invoke(Method.java:515) E/AndroidRuntime( 1646): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:825) E/AndroidRuntime( 1646): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:641) E/AndroidRuntime( 1646): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime( 1646): Caused by: java.lang.IllegalArgumentException: Unable to find native library: main E/AndroidRuntime( 1646): at android.app.NativeActivity.onCreate(NativeActivity.java:171) E/AndroidRuntime( 1646): at com.unity3d.player.UnityPlayerNativeActivity.onCreate(Unknown Source) E/AndroidRuntime( 1646): at com.developername.project.KidActivity.onCreate(KidActivity.java:23) E/AndroidRuntime( 1646): at android.app.Activity.performCreate(Activity.java:5343) E/AndroidRuntime( 1646): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1088) E/AndroidRuntime( 1646): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2331) E/AndroidRuntime( 1646): ... 11 more

Thank you!

Comment
Add comment · 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 eezSZI · Apr 24, 2015 at 12:32 PM 0
Share

We are having a very similar issue. Did you ever find a work-around?

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by dsgermainatlvlstudio-com · May 12, 2015 at 09:35 AM

By replacing the class NativeActivity with Activity, we are able to specify the load location of the libraries from code. This works flawlessly.

Comment
Add comment · Show 1 · 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
avatar image eezSZI · May 12, 2015 at 02:48 PM 0
Share

Thank you! That is the answer recently given to me by a Unity developer as well and the solution I went with. Apparently Unity 5 is going back to using Activity by default.

http://forum.unity3d.com/threads/specify-libs-location.104482/

http://forum.unity3d.com/threads/pre-installed-apk-unable-to-find-native-library-main.321210/

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.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Is it possible to make a custom launcher? 1 Answer

Mac OS X Build Execute File? 1 Answer

TypeLoadException with libraries in C# 1 Answer

Managing .dll files 0 Answers

Game Launcher Image. 1 Answer


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