model-viewer icon indicating copy to clipboard operation
model-viewer copied to clipboard

"View in AR" button sometimes only opens fullscreen instead of SceneViewer

Open hybridherbst opened this issue 7 years ago • 44 comments

Description

The "View in AR" button is correctly shown. However, for some models, pressing it just makes everything glitch around (some onsceen elements appear, some disappear, some just blank out), pressing it again makes the model go fullscreen, but SceneViewer isn't launched.

Live Demo

https://lemon-town.glitch.me/ but also happens with the default astronaut guy sometimes https://model-viewer.glitch.me/ Video of the behaviour: https://youtu.be/t6uQEcQDnBU

Browser Affected

  • [X] Chrome
  • [ ] Edge
  • [ ] Firefox
  • [ ] Helios
  • [ ] IE
  • [ ] Safari

OS

  • [X] Android, latest Chrome
  • [ ] iOS
  • [ ] Linux
  • [ ] MacOS
  • [ ] Windows

Versions

happens with both 0.3x and 0.4x Device is Xiaomi Mi 9, but have also seen on other Android phones

hybridherbst avatar Aug 06 '19 09:08 hybridherbst

Hey Soraryu, thanks for reporting! I'm tracking another issue that I believe is the same: https://github.com/GoogleWebComponents/model-viewer/issues/692

I'm looking into the issue and will report back here when I have news.

cdata avatar Aug 06 '19 15:08 cdata

I am seeing similar behavior on all of my sites that use model-viewer.

In one particularly peculiar case I have a number of buttons that change the source of the model-viewer. I also have a view button that triggers the activateAR() model viewer function. After restarting my device and clearing my cache the SceneViewer will launch consistently for all models if the user interacts with the buttons that change the model source before using the view in AR button. After testing for some time even changing the model viewer source doesn't guarantee the model will launch in the SceneViewer. It should also be noted that after a model is opened in fullscreen mode all subsequent models will also open in fullscreen mode.

dayliff-svr avatar Aug 06 '19 17:08 dayliff-svr

@dayliff-svr thanks for confirming the report. We are looking into the issue.

The fundamental problem appears to be that our "fullscreen fallback" that we use when Scene Viewer is not available is conflicting with the launch of Scene Viewer. It leads to a critical failure where Scene Viewer launch is interrupted, and also <model-viewer> fails to go into its fullscreen fallback mode.

I'm working with the Scene Viewer team to diagnose the source of the problem, and will update this issue as we put a fix into place. Thanks!

cdata avatar Aug 06 '19 17:08 cdata

Note that I was able to get the models that had issues on the Mi 9 to work on a Galaxy S9 and iPad Pro. All 3 are officially supported ARCore devices and there were no system updates on the Mi. Currently installed ARCore version is 1.11 which I verified as working just a couple of days ago with one of the models that is now failing to open at all.

hybridherbst avatar Aug 06 '19 17:08 hybridherbst

@soraryu Understood. There is more than just the ARCore version to consider, unfortunately.

cdata avatar Aug 06 '19 17:08 cdata

I'm having the same problem with both .gltf and .glb objects. The iOS version with .usdz file is working fine tho.

mischoko avatar Aug 06 '19 18:08 mischoko

Do you think there might be a connection to Google today renaming ARCore to "Google Services for AR"? I hope that didn't change the actual package name and accompanying intents... The S9 that worked didn't have that rename update yet while the Mi 9 did as I just found out.

hybridherbst avatar Aug 06 '19 18:08 hybridherbst

If it were just a matter of changing the intent, we would already have a fix landed. Unfortunately, it's more complicated than that.

There is a related dependency in the Google Search app. A recent update to that app may be the source of the issue.

cdata avatar Aug 06 '19 18:08 cdata

After further investigation, it appears as though this issue may have been introduced in Chrome 76. If you all can confirm which versions of Chrome you are seeing the issue in, that would be very helpful 🙇 @soraryu @mischoko @dayliff-svr

cdata avatar Aug 06 '19 19:08 cdata

@cdata Yup, chrome76 here tested on 3 devices

mischoko avatar Aug 06 '19 19:08 mischoko

@cdata my 2 devices were both using chrome 76.

dayliff-svr avatar Aug 06 '19 19:08 dayliff-svr

Yes, can confirm, Chrome 76.0.3809.89

hybridherbst avatar Aug 06 '19 19:08 hybridherbst

Chrome/76.0.3809.89 Sometimes the AR view starts correctly. But I don't know if there is any rule here.

PawelGIX avatar Aug 06 '19 19:08 PawelGIX

A quick update for everyone on what I have discovered so far:

  • There seems to be a Chrome bug, and I'm preparing a test case and some logs to record it on crbug.com
  • Separately, we (specifically @azakus) have come up with a workaround that might restore the previous behavior in m76, even if the Chrome bug isn't fixed. We are testing it now
  • If we ship a hot fix for this issue, it will be based on v0.5.0 and be released as v0.5.1, and you can expect it within the next 24 hours

cdata avatar Aug 06 '19 23:08 cdata

Thanks for jumping on this bug so swiftly.

I too noticed the same behaviour. Sounds like you've identified the cause, but I just wanted to add further confirmation:

  • I had 3 Android devices all testing fine with the default astronaut example as well as my own project.
  • Also multiple iOS devices, all working fine.
  • 2 of the Android devices stopped working (both astronaut and my project), in the way described above - model preview loads correctly, tapping AR icon opened fullscreen, but the "View in your space' button did not show and so unable to view in AR).
  • 1 Android device still workd.
  • iOS devices still worked.
  • Upon checking the Chrome version, the 2 devices that stopped working are now running v76.
  • The Android device that is still working is still running Chrome v75.

Thanks and good luck.

milesgreen avatar Aug 07 '19 15:08 milesgreen

FYI for those tracking this issue: draft for hotfix is up in #698 . We still need to test iOS to make sure we didn't regress Quick Look.

cdata avatar Aug 07 '19 17:08 cdata

@milesgreen @soraryu @dayliff-svr @mischoko @PawelGIX @arturomarruffo v0.5.1 has been released and published to npm. You can also get it on unpkg.com.

We only have a handful of devices to test on (and all of my local devices are Pixel phones). If you have time, please upgrade and try it out on your affected devices so that we can make sure that the fix is satisfactory.

Thank you!

cdata avatar Aug 07 '19 18:08 cdata

What do I have to do to force an update / do I need to wait for some kind of CDN to bubble through? Default astronaut is still broken right now.

Edit: by remixing the default astronaut I saw that it has 0.5.0 hardcoded and thus is still broken. Removing 0.5.0 (and thus always using the latest) makes it work again (I think using the latest should be default for your examples).

I went through all my model-viewer usages and found that (obviously) all that specify a version now are broken, the ones that don't are working. I didn't really pay attention to this in the past but since I usually copy-pasted from the astronaut example all of mine have different hardcoded versions now. Time to update.

hybridherbst avatar Aug 07 '19 18:08 hybridherbst

Not sure if it's related, but there seems to still be issues with a) models disappearing after returning from SceneViewer b) occasional issues with SceneViewer loading with black background instead of white and never being done loading c) occasional messages from SceneViewer "can't load model, there was an error" on repeated loading of the same model

hybridherbst avatar Aug 07 '19 19:08 hybridherbst

@soraryu Thanks for checking it out! We generally do update our examples as we release new versions, but in this case I wanted to hear some verification from the folks in this thread in case we needed to explore a second hotfix to address device-specific issues.

As to your other comments:

a) models disappearing after returning from SceneViewer

Yes, this is related to #619 and we will be releasing a fix with v0.6.0 (probably in about a week or two).

b) occasional issues with SceneViewer loading with black background instead of white and never being done loading

This is an interesting issue that I had not heard before. Would you be willing to file an issue with a screenshot so that I can share it with the Scene Viewer team?

c) occasional messages from SceneViewer "can't load model, there was an error" on repeated loading of the same model

This is also new for me. Any test cases you can provide could help the team diagnose. Please file an issue if you come up with one!

cdata avatar Aug 07 '19 21:08 cdata