Repository navigation
Troubleshooting
Usually the compass. Check tracker.getHeadingAccuracyDegrees() and tracker.getSource().
- Keep the phone upright, pointing at the horizon. Compass readings are ignored when it points steeply up or down.
- Move away from cars, steel structures and magnets, including magnetic phone cases and mounts.
- If Android shows a compass calibration prompt, follow it, or move the phone in a figure of eight.
- Use the Geospatial API if you can. Its heading is usually accurate to a few degrees.
Usually GPS. Placement improves over the first minute, especially if the user walks around. Check tracker.getHorizontalAccuracyMetres(). Indoors and between tall buildings, GPS can be off by 50 metres or more.
If the user granted approximate location only, placement can be off by a kilometre or more. ArLocationPermissions.hasApproximateLocationOnly(context) detects this.
Check the coordinate order. GeoCoordinate.of takes latitude first, then longitude. 1.x took longitude first.
- Check location permission was granted and location is turned on.
-
tracker.updatemust be called every frame. With the Sceneform module,LocationScenedoes this for you. - GPS fixes worse than 30 metres are ignored. Change this with
setMinimumHorizontalAccuracyMetres. - ARCore must be tracking. Location readings are paired with camera positions, so nothing is recorded while tracking is lost.
Point the camera at the horizon and hold still for a moment. Headings are only recorded when the camera is within about 60 degrees of horizontal and the phone isn't turning quickly.
Check tracker.getEarthState():
-
nullmeans the session doesn't have Geospatial mode enabled. -
ERROR_NOT_AUTHORIZEDmeans the API key or keyless setup is wrong. -
ERROR_RESOURCE_EXHAUSTEDmeans the Google Cloud project has hit its quota.
The tracker also waits until the Geospatial horizontal accuracy is 15 metres or better. See Geospatial API.
Renderers don't draw anything beyond their camera's far clipping plane. Keep the maximum render distance (the third argument to GeoTracker.place) below it, and further targets are drawn at that distance in the right direction. Sceneform clips at 30 metres, so with the Sceneform module keep setMaxRenderDistanceMetres below 30.
This happens with the Sceneform module. Its Filament libraries aren't 16 KB aligned, and Sceneform is archived, so this can't be fixed there. Use the core module instead; see Getting started.