Log in or register to post comments

Unity export to eclipse: unable to find native library main

June 4, 2013 - 12:15pm #1

I'm making an application in unity, in a different android project (using eclipse) i have an application that calls the unity project.

I built an eclipse project from unity, after that in eclipse imported the generated project and marked as library. In my project marked the generated project as reference, added the classes.jar from Unity androidplayback, copied the assets folder from unity generated project to my project's folder and compiled.

I tried to run my application in a Galaxy S3 which has ARMv7, and tried it in my emulator, in both i got the error message

06-04 19:00:54.643: E/AndroidRuntime(786): FATAL EXCEPTION: main
06-04 19:00:54.643: E/AndroidRuntime(786): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.prueba/com.qualcomm.QCARUnityPlayer.RDNativeActivity}: java.lang.IllegalArgumentException: Unable to find native library: main
06-04 19:00:54.643: E/AndroidRuntime(786): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
06-04 19:00:54.643: E/AndroidRuntime(786): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
06-04 19:00:54.643: E/AndroidRuntime(786): at android.app.ActivityThread.access$600(ActivityThread.java:141)
06-04 19:00:54.643: E/AndroidRuntime(786): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
06-04 19:00:54.643: E/AndroidRuntime(786): at android.os.Handler.dispatchMessage(Handler.java:99)
06-04 19:00:54.643: E/AndroidRuntime(786): at android.os.Looper.loop(Looper.java:137)
06-04 19:00:54.643: E/AndroidRuntime(786): at android.app.ActivityThread.main(ActivityThread.java:5041)
06-04 19:00:54.643: E/AndroidRuntime(786): at java.lang.reflect.Method.invokeNative(Native Method)
06-04 19:00:54.643: E/AndroidRuntime(786): at java.lang.reflect.Method.invoke(Method.java:511)
06-04 19:00:54.643: E/AndroidRuntime(786): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
06-04 19:00:54.643: E/AndroidRuntime(786): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
06-04 19:00:54.643: E/AndroidRuntime(786): at dalvik.system.NativeStart.main(Native Method)
06-04 19:00:54.643: E/AndroidRuntime(786): Caused by: java.lang.IllegalArgumentException: Unable to find native library: main
06-04 19:00:54.643: E/AndroidRuntime(786): at android.app.NativeActivity.onCreate(NativeActivity.java:181)
06-04 19:00:54.643: E/AndroidRuntime(786): at com.qualcomm.QCARUnityPlayer.RDNativeActivity.onCreate(RDNativeActivity.java:24)
06-04 19:00:54.643: E/AndroidRuntime(786): at android.app.Activity.performCreate(Activity.java:5104)
06-04 19:00:54.643: E/AndroidRuntime(786): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
06-04 19:00:54.643: E/AndroidRuntime(786): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
06-04 19:00:54.643: E/AndroidRuntime(786): ... 11 more
 
It seems like the native library main is missing, but i couldn't find anything related to this issue. Thanks for your replies

 

Unity export to eclipse: unable to find native library main

September 15, 2013 - 10:53am #7
09-16 01:52:47.922: E/AudioPolicyManagerBase(117): unknown stream type
 

09-16 01:52:55.790: E/SurfaceFlinger(114): SurfaceFlinger translucent=0 isOpaque=1 isExternalDisplayLayer=0 isExternalBlockLayer0

 

Unity export to eclipse: unable to find native library main

September 14, 2013 - 4:46pm #6

Do you see any errors in your log when launching the app on a device? - the Eclipse DDMS will enable you to observe the build and run log output for your app.

Unity export to eclipse: unable to find native library main

September 14, 2013 - 3:38pm #5
i have create a simple app in vuforia augmented reality using unity 
that Allows me to Extending Unity Android Activity and Adding Custom Views in Eclipse 
but when i run the project   the splash screen shows(black screen) up of unity but after a while it closes
 
so any one can help me here 
thank you 

Unity export to eclipse: unable to find native library main

June 4, 2013 - 11:48pm #4

You're welcome. glad to help.

Unity export to eclipse: unable to find native library main

June 4, 2013 - 2:36pm #3

Thank you, i followed the guide, at least my application shows up the splash screen of unity but after a while it closes and logcat shows this exception:

 

06-04 21:09:13.827: I/dalvikvm(1111): java.lang.NoClassDefFoundError: com/qualcomm/VuforiaMedia/VideoPlayerHelper
06-04 21:09:13.827: I/dalvikvm(1111): at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
06-04 21:09:13.827: I/dalvikvm(1111): at com.unity3d.player.UnityPlayer.onDrawFrame((null):-1)
06-04 21:09:13.827: I/dalvikvm(1111): at com.qualcomm.QCARUnityPlayer.QCARUnityPlayer.onDrawFrame(QCARUnityPlayer.java:67)
06-04 21:09:13.827: I/dalvikvm(1111): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1516)
06-04 21:09:13.827: I/dalvikvm(1111): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
06-04 21:09:13.837: I/dalvikvm(1111): Caused by:
06-04 21:09:13.888: I/dalvikvm(1111): java.lang.ClassNotFoundException: Didn't find class "com.qualcomm.VuforiaMedia.VideoPlayerHelper" on path: /data/app/com.research.fragmenttabstudy-1.apk
06-04 21:09:13.888: I/dalvikvm(1111): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
06-04 21:09:13.888: I/dalvikvm(1111): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
06-04 21:09:13.888: I/dalvikvm(1111): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
06-04 21:09:13.888: I/dalvikvm(1111): at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
06-04 21:09:13.888: I/dalvikvm(1111): at com.unity3d.player.UnityPlayer.onDrawFrame((null):-1)
06-04 21:09:13.897: I/dalvikvm(1111): at com.qualcomm.QCARUnityPlayer.QCARUnityPlayer.onDrawFrame(QCARUnityPlayer.java:67)
06-04 21:09:13.916: I/dalvikvm(1111): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1516)
06-04 21:09:13.916: I/dalvikvm(1111): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
 
am i missing something?
 
EDIT:
 
I found the problem, and it's that i didn't copy the VuforiaMedia.jar into libs/ folder, thank you very much it is now running

Unity export to eclipse: unable to find native library main

June 4, 2013 - 1:12pm #2

Hi, have you checked this article:

https://developer.vuforia.com/resources/dev-guide/extending-unity-android-activity-and-adding-custom-views-eclipse

It explains how to export a Unity project to Eclipse.

If you follow it step-by-step, you should be able to come up with a running project in Eclipse.

Log in or register to post comments