googlearchive / tango-examples-unity

Project Tango [deprecated] UnitySDK Example Projects
https://developers.google.com/ar
Apache License 2.0
470 stars 242 forks source link

Examples crashing when built with Unity 2017.1 #102

Closed Okaerikoto closed 7 years ago

Okaerikoto commented 7 years ago

I just installed Unity 2017.1.0f3 and tried to compile the examples but all of them crash at start on my Lenovo Phab 2 Pro (Tango version 1.55).

I loaded the project tango-examples-unity\UnityExamples in Unity without modifying it and Unity converts it to my Unity version. The building seems to run fine but on the phone the resulting app crashes at start.

Here are the logs of the Tango when I launch the app and the console output on Unity after building the app. Logs Tango Console Unity

Everything worked fine for me on Unity 5.6.

bopangzz commented 7 years ago

Thanks for the bug report. We will look into the issue.

friuns2 commented 7 years ago

here compiles fine but crashes on runtime instantly Caused by: java.lang.NoSuchMethodError: No direct method <init>(Landroid/content/ContextWrapper;)V in class Lcom/unity3d/player/UnityPlayer; or its super classes (declaration of 'com.unity3d.player.UnityPlayer' appears in /data/app/com.DeltaCygniLabs.Pointr-2/base.apk) at com.google.unity.GoogleUnityActivity.onCreate(GoogleUnityActivity.java:106) at android.app.Activity.performCreate(Activity.java:6285) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2370) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2477) at android.app.ActivityThread.access$900(ActivityThread.java:150) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5418) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

ultra-sonic commented 7 years ago

same here...compiles fine but crashes instantly on device (Zenfone AR)

danzeeeman commented 7 years ago

I'm getting the same on a Tango Example

ObjSal commented 7 years ago

I still don't know why, but recompiling google_unity_wrapper.aar fixed the java.lang.NoSuchMethodError runtime crash for me.

danzeeeman commented 7 years ago

I down graded to Unity 5.6.2p4 and everything works fine

salgue commented 7 years ago

@danzeeeman even though what you say might work, I don't think is a solution for the long run.

@chaosemer also claims that for a stable Tango development we use Unity versions 5.2 - 5.6 in issue #103

My question is, when is Tango going to be supported in Unity 2017 for stable development?

Should we even be worried that the support for the tango plugin might get dropped?

chaosemer commented 7 years ago

Don't worry, Tango isn't getting dropped. 2017.2 brings native Tango support and we're focused on making that awesome.

YohanBaillot commented 7 years ago

Just tried with 2017.2 beta and the crash still exists. Will this be expected to be fixed when 2017.2 is released? This seems to suggest not unless it wont be fixed for the beta but will be for the release? Thanks for any insight https://issuetracker.unity3d.com/issues/tango-the-project-with-imported-tango-sdk-crashes-both-on-non-tango-and-tango-devices

aresares commented 7 years ago

@ObjSal sorry how did you recompilet google_unity_wrapper.aar

ObjSal commented 7 years ago

Sorry if I get something wrong, I paused my Tango development till Unity fixes the Tango support in Unity 2017+.

The below steps only fixed the issue where the app crashes with No direct method <init>(Landroid/content/ContextWrapper;)V in class Lcom/unity3d/player/UnityPlayer when running from the device; debugging/running directly from Unity won't work.

Note that my case is not a usual scenario for Unity developers, because when I export the android project I include it as a library in another android project; here are the steps just in case it helps:

I downloaded the Tango libraries and copy them to the below locations: AndroidIntegration/GoogleUnityWrapper/aar/tango-cloud-lib.aar AndroidIntegration/GoogleUnityWrapper/aar/tango-ux-support-library.aar AndroidIntegration/GoogleUnityWrapper/aar/tango_java_lib.aar AndroidIntegration/GoogleUnityWrapper/aar/tango_unity_helper.aar AndroidIntegration/GoogleUnityWrapper/aar/unity_ux_helper.aar

I then copy the unity-classes.jar from Unity 2017 and place it in: AndroidIntegration/GoogleUnityWrapper/unity-classes.jar

Then I created a build.gradle within AndroidIntegration/GoogleUnityWrapper/, you may see the script within this gist as the formatting didn't work well here.

Then build using Android Studio:

screen shot 2017-08-21 at 12 36 08 pm

The AAR file should be generated in the build output directory.

I hope Unity fixes their (or this plugin) implementation.

YohanBaillot commented 7 years ago

Thanks Salavador. Anyway you could share the AAR file?

On Mon, Aug 21, 2017 at 11:38 AM, Salvador Guerrero < notifications@github.com> wrote:

Sorry if I get something wrong, I paused my Tango development till Unity fixes the Tango support in Unity 2017+.

The below steps only fixed the issue where the app crashes with No direct method (Landroid/content/ContextWrapper;)V in class Lcom/unity3d/player/UnityPlayer when running from the device; debugging/running directly from Unity won't work.

Note that my case is not a usual scenario for Unity developers, because when I export the android project I include it as a library in another android project; here are the steps just in case it helps:

I downloaded the Tango libraries and copy them to the below locations: AndroidIntegration/GoogleUnityWrapper/aar/tango-cloud-lib.aar AndroidIntegration/GoogleUnityWrapper/aar/tango-ux-support-library.aar AndroidIntegration/GoogleUnityWrapper/aar/tango_java_lib.aar AndroidIntegration/GoogleUnityWrapper/aar/tango_unity_helper.aar AndroidIntegration/GoogleUnityWrapper/aar/unity_ux_helper.aar

I then copy the unity-classes.jar from Unity 2017 and place it in: AndroidIntegration/GoogleUnityWrapper/unity-classes.jar

Then I created a build.gradle within AndroidIntegration/GoogleUnityWrapper/, you may see the script within this gist https://gist.github.com/ObjSal/a3e71d6321942df34965d360d5777e67 as the formatting didn't work well here.

Then build using Android Studio: [image: screen shot 2017-08-21 at 12 36 08 pm] https://user-images.githubusercontent.com/1055104/29533078-62960642-866d-11e7-8d67-3b4364a2c359.png

The AAR file should be generated in the build output directory.

I hope Unity fixes their (or this plugin) implementation.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/googlesamples/tango-examples-unity/issues/102#issuecomment-323819699, or mute the thread https://github.com/notifications/unsubscribe-auth/AArUdZTDODm2rUSW75EEZmtt9TwckNmiks5sac6ygaJpZM4OXRXs .

--


Yohan Baillot

LinkedIn www.linkedin.com/in/yohanbaillot

ARCortex CEO and Founder Expert Augmented Reality visualization consulting www.arcortex.com

SetoKaiba commented 7 years ago

https://plus.google.com/103286785170955278420/posts/H6GGckGyvM7 Why not just use the aar I shared. And modify the DynamicMesh.cs yourself. I just modify the byte code directly in the class. And it's working.

But I'm just curious whether anyone makes the 2017.2 built-in integration work. Mine reports failed to connect to Tango.

neelkadia-zz commented 7 years ago

How to solve this?

08-25 10:39:56.730: E/AndroidRuntime(8738): Caused by: java.lang.NoSuchMethodError: No direct method <init>(Landroid/content/ContextWrapper;)V in class Lcom/unity3d/player/UnityPlayer; or its super classes (declaration of 'com.unity3d.player.UnityPlayer' appears in /data/app/com.xyz.abc/base.apk)

SetoKaiba commented 7 years ago

Read the google plus post above. @neelkadia

developer-power-ro commented 7 years ago

Thank you @SetoKaiba. Life savior. Same scenario: 2017.1f1 version and Asus AR. Guys, don't forget to add || UNITY_2017 at line 628 in TangoDynamicMesh.cs