Log in or register to post comments

Using ar unity as android app module

July 4, 2012 - 6:12am #1

Hello all,

I want to use my Unity ar project in a app I already made as a new activity. Now I'm following this example:

http://forum.unity3d.com/threads/71607-Integrating-Unity-and-Eclipse

and

http://docs.unity3d.com/Documentation/Manual/PluginsForAndroid.html

But it wont work I'm getting errors like:

Unable to resolve superclass of OverrideExample

and

NoClassDefFoundError

Any ideas how to do it the right way? 

Using ar unity as android app module

September 28, 2012 - 4:43am #15

Was this issue solved. I am getting the same error after follwinng the documented steps http://forum.unity3d.com/threads/71607-Integrating-Unity-and-Eclipse

 

09-28 17:02:37.522: E/AndroidRuntime(18714): FATAL EXCEPTION: main
09-28 17:02:37.522: E/AndroidRuntime(18714): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.qualcomm.QCARUnityPlayer/com.qualcomm.QCARUnityPlayer.QCARPlayerProxyActivity}: java.lang.ClassNotFoundException: com.qualcomm.QCARUnityPlayer.QCARPlayerProxyActivity in loader dalvik.system.PathClassLoader[/data/app/com.qualcomm.QCARUnityPlayer-1.apk]
09-28 17:02:37.522: E/AndroidRuntime(18714):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1738)
09-28 17:02:37.522: E/AndroidRuntime(18714):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1837)
09-28 17:02:37.522: E/AndroidRuntime(18714):     at android.app.ActivityThread.access$1500(ActivityThread.java:132)
09-28 17:02:37.522: E/AndroidRuntime(18714):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1033)
09-28 17:02:37.522: E/AndroidRuntime(18714):     at android.os.Handler.dispatchMessage(Handler.java:99)
09-28 17:02:37.522: E/AndroidRuntime(18714):     at android.os.Looper.loop(Looper.java:143)
09-28 17:02:37.522: E/AndroidRuntime(18714):     at android.app.ActivityThread.main(ActivityThread.java:4196)
09-28 17:02:37.522: E/AndroidRuntime(18714):     at java.lang.reflect.Method.invokeNative(Native Method)
09-28 17:02:37.522: E/AndroidRuntime(18714):     at java.lang.reflect.Method.invoke(Method.java:507)
09-28 17:02:37.522: E/AndroidRuntime(18714):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
09-28 17:02:37.522: E/AndroidRuntime(18714):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
09-28 17:02:37.522: E/AndroidRuntime(18714):     at dalvik.system.NativeStart.main(Native Method)
09-28 17:02:37.522: E/AndroidRuntime(18714): Caused by: java.lang.ClassNotFoundException: com.qualcomm.QCARUnityPlayer.QCARPlayerProxyActivity in loader dalvik.system.PathClassLoader[/data/app/com.qualcomm.QCARUnityPlayer-1.apk]
09-28 17:02:37.522: E/AndroidRuntime(18714):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
09-28 17:02:37.522: E/AndroidRuntime(18714):     at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
09-28 17:02:37.522: E/AndroidRuntime(18714):     at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
09-28 17:02:37.522: E/AndroidRuntime(18714):     at android.app.Instrumentation.newActivity(Instrumentation.java:1061)

Using ar unity as android app module

September 4, 2012 - 1:21am #14

Any ideas what it could be? I'm using the new sdk I read that they changed the way jar files are loaded you should now add them to the libs folder but when I do that it does not work eather.

Using ar unity as android app module

July 18, 2012 - 6:49am #13

Yes see your inbox.

Using ar unity as android app module

July 17, 2012 - 12:51pm #12

Can you send me the project?

Using ar unity as android app module

July 17, 2012 - 12:13pm #11

Nope I created the project from Unity. So this is not the solution of the problem grr.

Using ar unity as android app module

July 17, 2012 - 8:56am #10

The NDK is required for the native Android SDK. But you should be able to use the shared libraries from Unity without it. Have you confirmed that these run as a stand-alone Unity project?

Using ar unity as android app module

July 17, 2012 - 2:14am #9

Could it be the problem that I don't have ndk installed? Is this required?

Using ar unity as android app module

July 10, 2012 - 5:48am #8

Yes I see the same when in debug mode.

Using ar unity as android app module

July 9, 2012 - 6:10pm #7

I wonder if Proguard is playing a role. Do you see the same when building in Debug mode?

Using ar unity as android app module

July 6, 2012 - 12:37am #6

That's strange I have this:

https://docs.google.com/file/d/0B-YKBtylPP4pR3ZiUkQ5V2tTT28/edit

And still it does not work could there be someting else what is wrong?

Using ar unity as android app module

July 5, 2012 - 8:05am #5

Yes that appears to be the same document ( thanks for catching that ). The errors that you're getting appear to derive from a native invocation (e.g. to a C++ shared library ).

This is what your project structure should look like in Eclipse. You'll want to confirm that the *.so's are present..

https://docs.google.com/file/d/0BxCRPTKkNDTxblVBYlhCZEhiMFk/edit

Using ar unity as android app module

July 5, 2012 - 5:46am #4

Ok I tried the steps many times today but I still getting errors when I run it on my device.

 

In my log:

07-05 14:38:48.430: E/AndroidRuntime(24526): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.qualcomm.QCARUnityPlayer/com.qualcomm.QCARUnityPlayer.QCARPlayerProxyActivity}: java.lang.ClassNotFoundException: com.qualcomm.QCARUnityPlayer.QCARPlayerProxyActivity in loader dalvik.system.PathClassLoader[/data/app/com.qualcomm.QCARUnityPlayer-2.apk]

07-05 14:38:48.430: E/AndroidRuntime(24526): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1742)

07-05 14:38:48.430: E/AndroidRuntime(24526): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1834)

07-05 14:38:48.430: E/AndroidRuntime(24526): at android.app.ActivityThread.access$500(ActivityThread.java:122)

07-05 14:38:48.430: E/AndroidRuntime(24526): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1027)

07-05 14:38:48.430: E/AndroidRuntime(24526): at android.os.Handler.dispatchMessage(Handler.java:99)

07-05 14:38:48.430: E/AndroidRuntime(24526): at android.os.Looper.loop(Looper.java:132)

07-05 14:38:48.430: E/AndroidRuntime(24526): at android.app.ActivityThread.main(ActivityThread.java:4126)

07-05 14:38:48.430: E/AndroidRuntime(24526): at java.lang.reflect.Method.invokeNative(Native Method)

07-05 14:38:48.430: E/AndroidRuntime(24526): at java.lang.reflect.Method.invoke(Method.java:491)

07-05 14:38:48.430: E/AndroidRuntime(24526): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844)

07-05 14:38:48.430: E/AndroidRuntime(24526): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)

07-05 14:38:48.430: E/AndroidRuntime(24526): at dalvik.system.NativeStart.main(Native Method)

07-05 14:38:48.430: E/AndroidRuntime(24526): Caused by: java.lang.ClassNotFoundException: com.qualcomm.QCARUnityPlayer.QCARPlayerProxyActivity in loader dalvik.system.PathClassLoader[/data/app/com.qualcomm.QCARUnityPlayer-2.apk]

07-05 14:38:48.430: E/AndroidRuntime(24526): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:251)

07-05 14:38:48.430: E/AndroidRuntime(24526): at java.lang.ClassLoader.loadClass(ClassLoader.java:540)

07-05 14:38:48.430: E/AndroidRuntime(24526): at java.lang.ClassLoader.loadClass(ClassLoader.java:500)

07-05 14:38:48.430: E/AndroidRuntime(24526): at android.app.Instrumentation.newActivity(Instrumentation.java:1022)

07-05 14:38:48.430: E/AndroidRuntime(24526): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1733)

07-05 14:38:48.430: E/AndroidRuntime(24526): ... 11 more

It seems that on runtime android is not able to load the jars that are included.

Any ideas how to solve this?

 

ps I found this link:

http://www.rbcafe.com/Softwares/Unity/Documentation/Manual/Android-Integrating%20Unity%20With%20Eclipse.html

is that the same as you posted?

Using ar unity as android app module

July 4, 2012 - 11:33pm #3

DavidBeard wrote:

Try these steps..

 

  1. Start with the Unity ImageTargets sample and follow this guide: http://unity3d.com/support/documentation/Manual/Android-Integrating%20Unity%20With%20Eclipse.html. You can skip the last section (Getting Your Unity Content Running) for now.

 

That link is not working but I asume that it's the same as guide as I already read.

I will try the steps you discribe thank you.

Using ar unity as android app module

July 4, 2012 - 12:21pm #2

Try these steps..

 

  1. Start with the Unity ImageTargets sample and follow this guide: http://unity3d.com/support/documentation/Manual/Android-Integrating%20Unity%20With%20Eclipse.html. You can skip the last section (Getting Your Unity Content Running) for now.
  2. Add QCAR.jar and QCARUnityPlayer.jar to the Java Build Path of your custom Android project. These are found in the StagingArea/plugins folder.
  3. Copy the StagingArea/raw/QCAR folder to the assets folder of your custom Android project.
  4. Copy the AndroidManifest.xml file from the StagingArea project to your custom Android project.
  5. Run your custom Android project. You should see the camera background and tracking should work.
Log in or register to post comments