google-ar / codelab-webxr

Building an augmented reality application with the WebXR Device API
https://codelabs.developers.google.com/codelabs/ar-with-webxr/
Apache License 2.0
171 stars 85 forks source link

Doesn't work in latest Canary, but no link to Canary v70-72 #21

Open spiderworm opened 5 years ago

spiderworm commented 5 years ago

The instructions say that it does not work in latest Canary, and that Canary 70-72 is needed. However, no link can be found to those versions of Canary, and Google searches for a version in that range turn up empty.

krzysioks commented 5 years ago

Hi, officially you cannot downgrade Canary. Still you could find mirrors with previous builds of Canary. I tried this way, but still codelab "ar-with-webxr" did not work. I've created the pull request with API alignment to the Canary ver. 73.0.3679.0. Here you can find the code: https://github.com/krzysioks/ar-with-webxr.

spiderworm commented 5 years ago

Thanks for that link, @krzysioks . Am I correctly understanding then that the problems with the codelab in current Canary is not due to features being removed from Canary, but only changed? So, conceivably, the demo could be made to work in current Canary version 74.0.3690.0?

vogloblinsky commented 5 years ago

@krzysioks Just tried your updated code with Chrome Canary v 73.0.3679.0 and Chrome crashed when i open the page.

Did someone know at this time which version works fine with API syntax ?

I have found in Chromium source code and in WebXR spec that navigator.xr.requestDevice() has moved to navigator.xr.supportsSessionMode('immersive-ar')

krzysioks commented 5 years ago

@spiderworm As @jsantell wrote in his comment https://github.com/googlecodelabs/ar-with-webxr/issues/18#issuecomment-456470333 the webxr API is undergoing a lot of changes, what includes also functions name changes. So the features are not going away they just being redesigned. Unfortunately changes are not offically documented anywere. So what I did to get codelab working was gathering information about API changes from various topics and change the function calls to get to work with version of Canary currently installed on my device.

@vogloblinsky About crashing Canary: I am not an expert in this topic, but from my research when the codelab ar tutorial stopped working after updating Canary I tried to downgrade Canary. I have not found any official way to do this. So I searched google and found mirrors with Canary builds. I installed more than 20 different version starting from November to early January and came out with exactly the same result as you: Canary crashed trying to start augmeneted reality. So I gave up on downgrading Canary and decided to not updating Canary (therefore my version of offically installed Canary (not installed from mirror page) is as I stated in pull request). Then having all information about API changes I made them in the codelab code, and it is working.

To sum up:

  1. If you have later version of Canary already installed on your device, downgrading to 73.0.3679.0 will not help.
  2. Instead, if my fork does not work on newer version of Canary, as you mentioned, maybe there are further API changes, and the code need to be aligned again to work with newest version of Canary.

So the best way to have it working is to align codelab to work with your installed version of Canary and do not update it unless there will be an officiall update of codelab AR tutorial.

vogloblinsky commented 5 years ago

@krzysioks yes i have used an apk from apkmirror of Chrome Dev v72. everything works fine. when i will play this codelab with my attendees, i will explain them that API has changed since v72 and the codelab needs update when everything will be stable

FangerZero commented 5 years ago

So is what I'm reading, it's safe to say that none of this WebAR stuff will work because of all the changes? Please say yes because I've been trying to figure it out for the past 2 days, or please give some steps to make it work.

vogloblinsky commented 5 years ago

@FangerZero i got this codelab works fine with Chrome Dev v72. After with v73+, APIs change and the code needs to be updated.

FangerZero commented 5 years ago

@vogloblinsky So it doesn't work out of the box. Seems have to know what you're doing to make it work on 73+? Because like I said I can't get anything to work even when I'm on canary 72. And is Chrome Dev the same as Chrome Canary?

vogloblinsky commented 5 years ago

I use Chrome dev v72 from apkmirror : https://www.apkmirror.com/apk/google-inc/chrome-dev/chrome-dev-72-0-3626-14-release/ Chrome Canary 72 crash for me. Chrome dev is the first step of Chrome versions :

vogloblinsky commented 5 years ago

PSA state of webxr

https://docs.google.com/document/d/1R8Bz0_vK9YmY5-ZhsbLtZ9-DDJpTOgNeibFD4SdUnbw/mobilebasic

FangerZero commented 5 years ago

Thanks for the help! I needed WebARonARCore, which I thought I already downloaded and tried it guess not. :D it's fun I can't wait to dig into more!

mohcanohca commented 5 years ago

@vogloblinsky Does this codelab still work fine on Chrome dev v72? My phone is Pixel 2 XL, Android 9. I have tried it on the version you mentioned, but it didn't work. I found navigator.xr coundn't be getted. I don't know what's wrong.

mohcanohca commented 5 years ago

@vogloblinsky Does this codelab still work fine on Chrome dev v72? My phone is Pixel 2 XL, Android 9. I have tried it on the version you mentioned, but it didn't work. I found navigator.xr coundn't be getted. I don't know what's wrong.