google-ar / arcore-unity-sdk

ARCore SDK for Unity
https://developers.google.com/ar
Other
1.4k stars 402 forks source link

Instant Preview "Not connected to editor" bug in Unity 2019.1.2f1 with ARCore 1.9 #566

Open vmlmf opened 5 years ago

vmlmf commented 5 years ago

SPECIFIC ISSUE ENCOUNTERED

VERSIONS USED

STEPS TO REPRODUCE THE ISSUE

  1. Connect the device through USB
  2. Click on Play mode in Unity and wait for any changes.
  3. The red "Not connected to editor" alert will remain as well as a white background screen in Play Mode.

WORKAROUNDS (IF ANY)

ADDITIONAL COMMENTS

I began having this issue in the last 4 days when I decided to update the SDKs from Android Studio and tried to test the HelloAR scene with the ARCore SDK 1.9 . At first I tought it could've been a bug and continued working on my other project but the "Not connected to editor" problem remained. After that, I tried debugging on my working computer (with Android SDKs already updated and ARCore SDK) and found that the problem wasnt on the device because the working project worked fine. Today, I decided to try the HelloAR scene with the 1.9 SDK only to find the same thing happening on both computers.

Is there any Workaround through this situation? I really need to continue with my project (since it's for academic purposes).

vinayak-vc commented 5 years ago

05-14 11:50:08.448 23458 23483 I InstantPreviewConnection: trying reconnect 05-14 11:50:08.448 23458 23483 I InstantPreviewConnection: onError: io.grpc.StatusRuntimeException: UNAVAILABLE: End of stream or IOException

I am getting this kind of error in ADB logcat

I am using ARCore 1.9 and Unity 2019.1.2f1 and yesterday instant preview was working like charm and today it is not just connecting.

VERSIONS USED Unity: 2019.1.2f1 ARCore SDK for Unity: V1.9.0 Device manufacturer, model, and O/S: Xiaomi Poco F1, Android Pie Output of adb shell getprop ro.build.fingerprint: Xiaomi/beryllium/beryllium:9/PKQ1.180729.001/V10.2.3.0.PEJMIXM:user/release-keys

@fredsa can you help here?

Chen-hao-Huang commented 5 years ago

Similar problem here with the red "Not connected to editor" alert Unity: 2019.1.2f1 ARCore SDK for Unity: 1.9 with S5e tablet andrioid 9.0 Any updates?

macklinb commented 5 years ago

I have the same problem with both the S7E and the Pixel 2. Tried a number of different versions of Unity 2019, but have had no luck. Instant Preview is launched every time I click play in the editor, but doesn't do anything past the "Not connected to editor" message. adb logcat spams InstantPreviewConnection: onError: io.grpc.StatusRuntimeException: UNAVAILABLE. It'd be great to get this fixed!

uffeflarup commented 5 years ago

I have the exact same problem. The Instant Preview app is unable to connect to editor, and the device log is spammed with "InstantPreviewConnection: onError: io.grpc.StatusRuntimeException: UNAVAILABLE". Have tried restarting Unity, restarting computer and restarting phone :) Didn't help unfortunately.

Unity 2018.4.2 ARCore 1.10 Samsung Galaxy S8

uffeflarup commented 5 years ago

Anyone knows any good work-arounds for this issue?

Gjohnson6 commented 5 years ago

In the Unity editor can you click on Help then Capture ARCore Bug Report then attach the file it creates in a comment here?

Thanks.

ryankwok commented 5 years ago

I am struggling with the same problem @Gjohnson6, on Unity 2017, ARCore 1.10, Galaxy S7 running Android 8.0.

Red "Not connected to editor" box and logcat is repeating InstantPreviewConnection: onError: io.grpc.StatusRuntimeException: UNAVAILABLE: (no "End of stream or IOException")

Thanks in advance

arcore_unity_editor_bug_report_20190702_063408.txt

Gjohnson6 commented 5 years ago

The version of Instant Preview included in ARCore SDK for Unity 1.9 doesn't work with adb 1.0.41. If you can, updating to ARCore SDK for Unity 1.10 should fix the problem.

ryankwok commented 5 years ago

Brilliant, thanks Grant. I will try that and get back to you.

ryankwok commented 5 years ago

Thanks @Gjohnson6, that seems to have fixed the issue related to this thread.

Unfortunately I am still not able to get instant preview working, now I am getting this error:

Attempted to enable 'Light Estimation' which is not yet supported by Instant Preview. Please build and run on device to use this feature. UnityEngine.Debug:LogErrorFormat(String, Object[]) GoogleARCoreInternal.InstantPreviewManager:LogLimitedSupportMessage(String) (at Assets/GoogleARCore/SDK/InstantPreview/Scripts/InstantPreviewManager.cs:105) GoogleARCoreInternal.ARCoreAndroidLifecycleManager:_SetConfiguration(ARCoreSessionConfig) (at Assets/GoogleARCore/SDK/Scripts/Managers/ARCoreAndroidLifecycleManager.cs:462) GoogleARCoreInternal.ARCoreAndroidLifecycleManager:_OnEarlyUpdate() (at Assets/GoogleARCore/SDK/Scripts/Managers/ARCoreAndroidLifecycleManager.cs:267) GoogleARCoreInternal.ARPrestoCallbackManager:_EarlyUpdateTrampoline() (at Assets/GoogleARCore/SDK/Scripts/Managers/ARPrestoCallbackManager.cs:166) GoogleARCoreInternal.NativeApi:Update() GoogleARCoreInternal.<UpdateLoop>c__Iterator1:MoveNext() (at Assets/GoogleARCore/SDK/InstantPreview/Scripts/InstantPreviewManager.cs:325) I'm cool with not having light estimation, I just want instant preview to work. But any attempts to suppress the error by commenting out the offending code or deactivating Environmental Light yields this error

EntryPointNotFoundException: ArLightEstimate_getTimestamp GoogleARCoreInternal.LightEstimateApi.GetTimestamp (IntPtr sessionHandle, IntPtr lightEstimateHandle) (at Assets/GoogleARCore/SDK/Scripts/Api/Wrappers/LightEstimateApi.cs:176) GoogleARCoreInternal.FrameApi.GetLightEstimate () (at Assets/GoogleARCore/SDK/Scripts/Api/Wrappers/FrameApi.cs:121) GoogleARCore.Frame.get_LightEstimate () (at Assets/GoogleARCore/SDK/Scripts/Frame.cs:76) GoogleARCore.EnvironmentalLight.Update () (at Assets/GoogleARCore/SDK/Scripts/EnvironmentalLight.cs:66)

macklinb commented 5 years ago

For me, both 1.9 and 1.10 of the SDK were not working with the version of adb included in platform-tools 28.0.2 (March 2019). I can confirm that simply updating platform-tools to the newest version (29.0.1-5644136, June 2019) fixes it for both versions. (https://developer.android.com/studio/releases/platform-tools).

You can check what version of adb/platform-tools you have installed with adb --version, and update it with sdkmanager --update or sdkmanager platform-tools, or by using the SDK manager within Android Studio (assuming it is installed).

For v1.10 the issues mentioned in #595 are still going to be a problem. Even if you don't use light estimation (and even if it is disabled in the session config), it seems to have a big performance impact on Instant Preview. 1.9 works, and seems to perform better, but still isn't exactly reliable.

This may be unrelated, but with the above setup, Instant Preview seems to crash both the editor and the device pretty often, after which it reverts to the "Not connected to editor" message until both the PC and the device are both restarted.

Maybe Instant Preview is just asking too much of everything. I feel like at this point it would be easier just to put up with the hassle of building and pushing a build each time - which is what I've been doing so far anyway.

macklinb commented 5 years ago

206 could also be related

vmlmf commented 5 years ago

Maybe Instant Preview is just asking too much of everything. I feel like at this point it would be easier just to put up with the hassle of building and pushing a build each time - which is what I've been doing so far anyway.

Been building the same way here. I feel a little frustrated about it though because it isn't fun rebuilding your app every 10 minutes for a fix.

The version of Instant Preview included in ARCore SDK for Unity 1.9 doesn't work with adb 1.0.41

You must apologize for my ignorance, but how do you check adb version?

For me, both 1.9 and 1.10 of the SDK were not working with the version of adb included in platform-tools 28.0.2 (March 2019). I can confirm that simply updating platform-tools to the newest version (29.0.1-5644136, June 2019) fixes it for both versions. (https://developer.android.com/studio/releases/platform-tools).

I just noticed that I had that version ready to update but somehow Android Studio didn't give me any notification of such. Maybe that will work for me too.

uffeflarup commented 5 years ago

@macklinb Thank you VERY much for the tip about updating platform tools. That (and restarting) solved the Instant Preview problem for me.

Thanks!

Dr4gonbl4de commented 5 years ago

Hi, I have the same problem. The Instant Preview App always shows not connected to Editor. Updating platform-tools didn't work for me. I've attached a Bug-Report file. Would be nice if someone could help me. arcore_unity_editor_bug_report_20190924_083649.txt

macklinb commented 5 years ago

@Dr4gonbl4de Also check out issue 630 above. I always get this error and taking those steps usually fixes it.

Dr4gonbl4de commented 5 years ago

@macklinb I tried this multiple times on multiple devices but it didn't worked. But thanks for your fast reply!

macklinb commented 5 years ago

@Dr4gonbl4de :( Well that's about everything that I could suggest, other than trying it with a newer version of Unity.

Avalin commented 5 years ago

I'm having the same problem.

Unity 2019.2.8f1, ARCore 1.12, Oneplus 5T, Android 9.0

Gjohnson6 commented 5 years ago

Hi Avalin, can you click Help > Capture ARCore Bug Report in the Unity Editor and attach the log file created? Thanks

sygeyacc commented 4 years ago

Hi I'm same probrem. and tried adb kill-server, adb start-server, adb reconnect

Unity 2019.2.17f1 ARcore 1.14.0 apk Google_Play_Services_for_AR_1.14.1 Android device huawei honor 8X(The built app worked fine.)

check the error with logcat, the following message will continue to be displayed.

12-25 12:33:28.527 24915 25002 I InstantPreviewConnection: onError: io.grpc.StatusRuntimeException: CANCELLED: Failed to read message. 12-25 12:33:28.527 24915 25002 I InstantPreviewConnection: trying reconnect

Unity capture ARcore report file. arcore_unity_editor_bug_report_20191225_123132.txt

cLick1338 commented 4 years ago

Posting what worked for me (2019.3) - The core cause can be that two different versions of adb are being used at different points in the process: If your Unity is using its own Android SDK Tools copy it's possible that InstantPreviewHelper.cs is being returned a different, wrong one (Unity's EditorPrefs may return the wrong path).

I fixed it by going to Unity's Preferences -> External Tools -> copy the path for "SDK Tools Installed with Unity", uncheck it and paste it over whatever value is already there, then (optionally but it's what I did) re-check the option.