AR-js-org / AR.js

Image tracking, Location Based AR, Marker tracking. All on the Web.
MIT License
5.3k stars 909 forks source link

Location based example not working on Android #538

Closed molleindustria closed 12 months ago

molleindustria commented 1 year ago

Do you want to request a feature or report a bug? Bug

What is the current behavior? The location based example on the repository main page doesn't work on Android, blank screen. The console errors are reported below.

If the current behavior is a bug, please provide the steps to reproduce.

Copy pasted the code, uploaded on my server and accessed it through chrome on android.

Console errors: Cannot read properties of undefined (reading 'degToRad') at i._haversineDist (aframe-ar.js:1:1647120) at HTMLElement.<anonymous> (aframe-ar.js:1:1646650) at HTMLElement.<anonymous> (a-node.js:263:16) at i._sendGpsUpdateEvent (aframe-ar.js:1:1645044) at Object.gpsupdate (aframe-ar.js:1:1643347) at g._gpsReceived (aframe-ar.js:1:787585) at aframe-ar.js:1:785950 _haversineDist @ aframe-ar.js:1 (anonymous) @ aframe-ar.js:1 (anonymous) @ a-node.js:263 _sendGpsUpdateEvent @ aframe-ar.js:1 (anonymous) @ aframe-ar.js:1 _gpsReceived @ aframe-ar.js:1 (anonymous) @ aframe-ar.js:1 ar-threex-location-only.js:1 Uncaught TypeError: Cannot read properties of undefined (reading 'degToRad') at l.update (ar-threex-location-only.js:1:7033) at i.tick (aframe-ar.js:1:1647739) at HTMLElement.value (a-scene.js:709:34) at HTMLElement.value (a-scene.js:759:36) at bind.js:12:17 at f (three.js:24703:38) at e (three.js:15038:4) update @ ar-threex-location-only.js:1 tick @ aframe-ar.js:1 value @ a-scene.js:709 value @ a-scene.js:759 (anonymous) @ bind.js:12 f @ three.js:24703 e @ three.js:15038 requestAnimationFrame (async) e @ three.js:15040 requestAnimationFrame (async) e @ three.js:15040 requestAnimationFrame (async) e @ three.js:15040 requestAnimationFrame (async) start @ three.js:15051 Qt.setAnimationLoop @ three.js:24717 (anonymous) @ a-scene.js:672 (anonymous) @ a-node.js:263 (anonymous) @ a-node.js:128 Promise.then (async) value @ a-node.js:125 value @ a-entity.js:245 (anonymous) @ a-scene.js:680 setTimeout (async) value @ a-scene.js:679 value @ a-scene.js:155 (anonymous) @ a-scene.js:129 (anonymous) @ a-node.js:263 checkUserCamera @ camera.js:98 (anonymous) @ camera.js:58 (anonymous) @ a-node.js:263 value @ a-entity.js:156 init @ camera.js:28 initComponent @ component.js:320 updateProperties @ component.js:302 module.exports.Component @ component.js:78 i @ component.js:662 value @ a-entity.js:332 value @ a-entity.js:495 value @ a-entity.js:463 (anonymous) @ a-entity.js:249 (anonymous) @ a-node.js:127 Promise.then (async) value @ a-node.js:125 value @ a-entity.js:245 value @ a-entity.js:88 value @ a-register-element.js:160 value @ a-register-element.js:160 m @ document-register-element.js:2 l @ document-register-element.js:2 f @ document-register-element.js:2

malejogs commented 1 year ago

There is an error in the documentation for the versions:

Location-based AR.js

For the A-Frame version:

`` `` `` ___ the latest version of ARjs now needs aframe 1.3.0, I recommend you to place a specific version of the packages to avoid these errors, you can try with the ones below:

<script type="text/javascript" src="https://aframe.io/releases/1.3.0/aframe.min.js" ></script>

<script type="text/javascript" src="https://www.unpkg.com/@ar-js-org/ar.js@3.4.5/three.js/build/ar-threex-location-only.js" ></script>

<script type="text/javascript" src="https://www.unpkg.com/@ar-js-org/ar.js@3.4.5/aframe/build/aframe-ar.js"></script>

crithes commented 1 year ago

But the positioning is not available

nickw1 commented 1 year ago

@malejogs thanks for that, will update the docs. Sorry for late reply, I have been very busy with work the last few weeks.

nickw1 commented 12 months ago

Have now updated the docs, sorry for the delay. They should now use A-Frame 1.3.0. Will close this now but feel free to reopen if you still have problems.

allestaire commented 4 months ago

There is still no clear information to this, got tried the above suggestion but still not working

I see This is the new docs

Nice got it work somehow, the text is showing now