Skip to content
This repository has been archived by the owner on Mar 2, 2018. It is now read-only.

Examples crashing when built with Unity 2017.1 #102

Closed
Okaerikoto opened this issue Jul 13, 2017 · 16 comments
Closed

Examples crashing when built with Unity 2017.1 #102

Okaerikoto opened this issue Jul 13, 2017 · 16 comments

Comments

@Okaerikoto
Copy link

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
Copy link

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

@friuns2
Copy link

friuns2 commented Jul 21, 2017

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
Copy link

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

@danzeeeman
Copy link

I'm getting the same on a Tango Example

@ObjSal
Copy link

ObjSal commented Jul 31, 2017

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

@danzeeeman
Copy link

I down graded to Unity 5.6.2p4 and everything works fine

@salgue
Copy link

salgue commented Aug 4, 2017

@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
Copy link
Contributor

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

@YohanBaillot
Copy link

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
Copy link

@ObjSal sorry how did you recompilet google_unity_wrapper.aar

@ObjSal
Copy link

ObjSal commented Aug 21, 2017

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
Copy link

YohanBaillot commented Aug 22, 2017 via email

@SetoKaiba
Copy link

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
Copy link

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
Copy link

Read the google plus post above. @neelkadia

@developer-power-ro
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests