Guides

Troubleshooting

Symptom-by-symptom fixes: several entries describe v1.0.0 behaviours that 1.1.0 fixed; each says which.

AR won't start on my phone, but works on desktop localhost

Almost certainly the secure context. WebXR immersive AR requires HTTPS (or localhost). A LAN address over plain HTTP loads the page but session creation fails; checkSupport() reports { supported: false, code: 'INSECURE_CONTEXT' } so you can tell this case apart from a genuinely unsupported device. Serve the page over HTTPS, see HTTPS and phone testing, or open this site's live demo, which is already HTTPS.

The session fails immediately on some Android devices

Fixed in 1.1.0. Session creation used to hard-require the WebXR local-floor feature; devices with immersive AR + hit-test but no local-floor failed outright. The engine now requests local-floor first and falls back to local, then viewer. If a session still fails immediately, check the secure context (above) and that the hit-test feature is available, that one is still required.

checkSupport() says yes, but the native session fails later

Fixed in 1.1.0. The native facade's checkSupport used to resolve {supported: true} unconditionally. It now returns the real ArCoreApk.checkAvailability() result, so an unsupported or ARCore-less device reports supported: false up front. Still handle startSession failure: availability can change between the check and the session (installs, updates, permissions).

My model never appears (hook placeModel)

Fixed in 1.1.0. The hook's placeModel(modelUrl, position, rotation, scale) used to require array shapes while its JSDoc described {x, y, z} objects, objects produced NaN transforms and invisible models. Transform inputs are now normalised at the engine boundary: positions accept [x, y, z] or {x, y, z}, rotations a quaternion array/object or Euler radians, scales a number, array or object (clamped to [0.1, 5]). If a model still never appears, check the placeModel result for an error / code (e.g. NO_SURFACE, no surface was hit yet).

detectedPlanes in the hook is always zero

Fixed in 1.1.0. The hook read array fields while the engine emits plane counts as numbers; it now reads the numbers. Plane listeners (ARView.onPlanes(), the engine's plane listener) receive {type, total, horizontal, vertical} as before.

placeModel(url, {x, y}) ignores where I tapped

Fixed in 1.1.0. The WebXR hitTest({x, y}) used to ignore its coordinates and always return the centre-screen hit. Non-centre coordinates now perform a ray-based hit test (hitTestAtPoint), so tap-point placement works; the centre coordinates still use the reticle path.

My reticle setting keeps turning back on

Fixed in 1.1.0. showReticle: false used to be forced back to true on session start, placement and removal. The setting is now honoured; setReticleVisible(false) also persists.

Every tap throws TypeError: options.modelUrl is not a function

Older versions required enableCustomization({ modelUrl }) to be a function. In 1.1.0 it accepts a URL string or a () => string function (use the function when the current product can change between taps). If you still see this error, you're on a pre-1.1.0 build. See Gestures.

Memory grows while users browse products

Fixed in 1.1.0. Removed/switched models are now disposed under a documented ownership rule, plane dots are disposed with their planes, and the model cache is LRU-capped (config.modelCacheLimit, default 20, entries with live placements are never evicted). For very long sessions you can also call clearModelCache() explicitly, and engine.dispose() (via ARView.destroy()) releases everything on teardown. Prefer switchModel() over repeated placeModel() calls for product switching, it reuses the placement instead of adding a new model.

takeScreenshot returns CAMERA_CAPTURE_UNAVAILABLE

The session has no WebXR camera access. Since 1.1.0, camera access is an explicit opt-in: start the session with enableScreenshots: true (ARView.create() or startSession()), lightEstimation: true no longer requests it. On browsers that don't expose camera frames at all, the code is expected even with the opt-in. Screenshots are best-effort: branch on result.success and hide the feature when it fails. See Screenshots.

An awaited hitTest never resolves after the user exits AR

Fixed in 1.1.0. The fallback hit-test path used to hang if the session ended first; it now settles on every path, including session end.

npx cap sync didn't register the Android plugin

Fixed in 1.1.0. The package now ships the capacitor metadata key, and cap sync auto-discovers the plugin, verified in a clean scratch Capacitor app (plugin in capacitor.plugins.json, :reticlexr in the generated settings, no manual settings.gradle edit). If discovery still fails, check you're on 1.1.0+ and that node_modules/reticlexr/package.json contains the capacitor key. See Capacitor setup.

placeModel rejects with MODEL_FORMAT_UNSUPPORTED on iOS

iOS (ARKit/RealityKit) cannot load GLB/GLTF at all. The iOS runtime looks for a USDZ source in this order: an explicit usdzPath / usdzUrl option, then a .usdz sibling next to the GLB (same folder, same base name — for remote models, the sibling URL is downloaded). If none exists, the call rejects with MODEL_FORMAT_UNSUPPORTED rather than pretending to place anything. Fix: convert the model to USDZ, ship the sibling file, or pass usdzUrl alongside modelUrl.

AR won't start on iOS: CAMERA_PERMISSION_DENIED / nothing happens in the Simulator

Two distinct causes. (1) The host app's Info.plist is missing NSCameraUsageDescription — iOS then denies camera access and startSession rejects with CAMERA_PERMISSION_DENIED. Add the string (see Getting started) and rebuild. (2) You are running in the iOS Simulator, which has no ARKit world tracking: checkSupport() reports unsupported there by design. Run on a real ARKit-capable iPhone/iPad from Xcode instead.

Importing the package in a non-React app pulls in React

Partly by design in 1.x: the package root still re-exports useARCore as a deprecated alias, and that entry imports React. Framework-agnostic code should import the subpaths instead, reticlexr/ar-view, reticlexr/web, reticlexr/gestures never touch React, and the hook lives at reticlexr/react. The root re-export is removed in the next major version.

A second native startSession shows a session but no rendering

Fixed in 1.1.0. The native render loop now has a dedicated stop flag and the plugin forwards Capacitor's pause/resume/destroy hooks, so a session restarted after stopSession in the same app run renders normally.