Shared types and enums

Shared types and constants.

Summary

Enumerations

ArStatus{
  AR_SUCCESS = 0,
  AR_ERROR_INVALID_ARGUMENT = -1,
  AR_ERROR_FATAL = -2,
  AR_ERROR_SESSION_PAUSED = -3,
  AR_ERROR_SESSION_NOT_PAUSED = -4,
  AR_ERROR_NOT_TRACKING = -5,
  AR_ERROR_TEXTURE_NOT_SET = -6,
  AR_ERROR_MISSING_GL_CONTEXT = -7,
  AR_ERROR_UNSUPPORTED_CONFIGURATION = -8,
  AR_ERROR_CAMERA_PERMISSION_NOT_GRANTED = -9,
  AR_ERROR_DEADLINE_EXCEEDED = -10,
  AR_ERROR_RESOURCE_EXHAUSTED = -11,
  AR_ERROR_NOT_YET_AVAILABLE = -12,
  AR_ERROR_CAMERA_NOT_AVAILABLE = -13,
  AR_ERROR_CLOUD_ANCHORS_NOT_CONFIGURED = -14,
  AR_ERROR_INTERNET_PERMISSION_NOT_GRANTED = -15,
  AR_ERROR_ANCHOR_NOT_SUPPORTED_FOR_HOSTING = -16,
  AR_ERROR_IMAGE_INSUFFICIENT_QUALITY = -17,
  AR_ERROR_DATA_INVALID_FORMAT = -18,
  AR_ERROR_DATA_UNSUPPORTED_VERSION = -19,
  AR_ERROR_ILLEGAL_STATE = -20,
  AR_ERROR_FINE_LOCATION_PERMISSION_NOT_GRANTED = -21,
  AR_ERROR_GOOGLE_PLAY_SERVICES_LOCATION_LIBRARY_NOT_LINKED = -22,
  AR_ERROR_RECORDING_FAILED = -23,
  AR_ERROR_PLAYBACK_FAILED = -24,
  AR_ERROR_SESSION_UNSUPPORTED = -25,
  AR_ERROR_METADATA_NOT_FOUND = -26,
  AR_UNAVAILABLE_ARCORE_NOT_INSTALLED = -100,
  AR_UNAVAILABLE_DEVICE_NOT_COMPATIBLE = -101,
  AR_UNAVAILABLE_APK_TOO_OLD = -103,
  AR_UNAVAILABLE_SDK_TOO_OLD = -104,
  AR_UNAVAILABLE_USER_DECLINED_INSTALLATION = -105
}
enum
Return code indicating success or failure of a function.
ArTrackingFailureReason{
  AR_TRACKING_FAILURE_REASON_NONE = 0,
  AR_TRACKING_FAILURE_REASON_BAD_STATE = 1,
  AR_TRACKING_FAILURE_REASON_INSUFFICIENT_LIGHT = 2,
  AR_TRACKING_FAILURE_REASON_EXCESSIVE_MOTION = 3,
  AR_TRACKING_FAILURE_REASON_INSUFFICIENT_FEATURES = 4,
  AR_TRACKING_FAILURE_REASON_CAMERA_UNAVAILABLE = 5
}
enum
Describes possible tracking failure reasons of an ArCamera.
ArTrackingState{
  AR_TRACKING_STATE_TRACKING = 0,
  AR_TRACKING_STATE_PAUSED = 1,
  AR_TRACKING_STATE_STOPPED = 2
}
enum
Describes the tracking state of an ArTrackable, an ArAnchor or the ArCamera.

Enumerations

ArStatus

 ArStatus

Return code indicating success or failure of a function.

Properties
AR_ERROR_ANCHOR_NOT_SUPPORTED_FOR_HOSTING

Hosting a Cloud Anchor failed because the anchor is not a type of anchor that is currently supported for hosting.

AR_ERROR_CAMERA_NOT_AVAILABLE

The Android camera has been reallocated to a higher priority application or is otherwise unavailable.

AR_ERROR_CAMERA_PERMISSION_NOT_GRANTED

The application does not have Android camera permission.

AR_ERROR_CLOUD_ANCHORS_NOT_CONFIGURED

The host/resolve function call failed because the Session is not configured for Cloud Anchors.

AR_ERROR_DATA_INVALID_FORMAT

The data passed in for this operation was not in a valid format.

AR_ERROR_DATA_UNSUPPORTED_VERSION

The data passed in for this operation is not supported by this version of the SDK.

AR_ERROR_DEADLINE_EXCEEDED

Acquire failed because the object being acquired was already released.

For example, this happens if the application holds an ArFrame beyond the next call to ArSession_update, and then tries to acquire its Point Cloud.

AR_ERROR_FATAL

An internal error occurred that the application should not attempt to recover from.

AR_ERROR_FINE_LOCATION_PERMISSION_NOT_GRANTED

The Android precise location permission (ACCESS_FINE_LOCATION) is required, but has not been granted prior to calling ArSession_configure when ArGeospatialMode is set to AR_GEOSPATIAL_MODE_ENABLED.

See Android documentation on Request location access at runtime for more information on how to request the ACCESS_FINE_LOCATION permission.

AR_ERROR_GOOGLE_PLAY_SERVICES_LOCATION_LIBRARY_NOT_LINKED

The Fused Location Provider for Android library is required, but wasn't found in the client app's binary prior to calling ArSession_configure when ArGeospatialMode is set to AR_GEOSPATIAL_MODE_ENABLED.

Ensure that your app includes the Fused Location Provider of Android library, and that your app's ProGuard rules are correctly set up for the Geospatial API.

When building your app, check the resulting binary with the APK Analyzer, and ensure that the built application binary includes the com.google.android.gms.location package, and that its contents are not renamed or minified.

AR_ERROR_ILLEGAL_STATE

A function has been invoked at an illegal or inappropriate time.

A message will be printed to logcat with additional details for the developer. For example, ArSession_resume will return this status if the camera configuration was changed and there is at least one unreleased image.

AR_ERROR_IMAGE_INSUFFICIENT_QUALITY

Attempted to add an image with insufficient quality (e.g., too few features) to the image database.

AR_ERROR_INTERNET_PERMISSION_NOT_GRANTED

ArSession_configure failed because the specified configuration required the Android INTERNET permission, which the application did not have.

AR_ERROR_INVALID_ARGUMENT

One of the arguments was invalid; either NULL or not appropriate for the operation requested.

AR_ERROR_METADATA_NOT_FOUND

The requested metadata tag cannot be found in input metadata.

AR_ERROR_MISSING_GL_CONTEXT

An operation required GL context but one was not available.

AR_ERROR_NOT_TRACKING

An operation was attempted that the session be in the AR_TRACKING_STATE_TRACKING state, but the session was not.

AR_ERROR_NOT_YET_AVAILABLE

Acquire failed because the data isn't available yet for the current frame.

For example, acquiring image metadata may fail with this error because the camera hasn't fully started.

AR_ERROR_PLAYBACK_FAILED

When playback failed.

AR_ERROR_RECORDING_FAILED

When recording failed.

AR_ERROR_RESOURCE_EXHAUSTED

There are no available resources to complete the operation.

In cases of acquire functions returning this error, this can be avoided by releasing previously acquired objects before acquiring new ones.

AR_ERROR_SESSION_NOT_PAUSED

An operation was attempted that requires the session be paused, but the session was running.

AR_ERROR_SESSION_PAUSED

An operation was attempted that requires the session be running, but the session was paused.

AR_ERROR_SESSION_UNSUPPORTED

Operation is unsupported with the current session.

AR_ERROR_TEXTURE_NOT_SET

A texture name was not set by calling ArSession_setCameraTextureName before the first call to ArSession_update.

AR_ERROR_UNSUPPORTED_CONFIGURATION

The configuration supplied to ArSession_configure is unsupported.

To avoid this error, ensure that Session_checkSupported() returns true.

AR_SUCCESS

The operation was successful.

AR_UNAVAILABLE_APK_TOO_OLD

The ARCore APK currently installed on device is too old and needs to be updated.

AR_UNAVAILABLE_ARCORE_NOT_INSTALLED

The ARCore APK is not installed on this device.

AR_UNAVAILABLE_DEVICE_NOT_COMPATIBLE

The device is not currently compatible with ARCore.

AR_UNAVAILABLE_SDK_TOO_OLD

The ARCore APK currently installed no longer supports the ARCore SDK that the application was built with.

AR_UNAVAILABLE_USER_DECLINED_INSTALLATION

The user declined installation of the ARCore APK during this run of the application and the current request was not marked as user-initiated.

ArTrackingFailureReason

 ArTrackingFailureReason

Describes possible tracking failure reasons of an ArCamera.

Properties
AR_TRACKING_FAILURE_REASON_BAD_STATE

Motion tracking lost due to bad internal state.

No specific user action is likely to resolve this issue.

AR_TRACKING_FAILURE_REASON_CAMERA_UNAVAILABLE

Motion tracking paused because the camera is in use by another application.

Tracking will resume once this app regains priority, or once all apps with higher priority have stopped using the camera. Prior to ARCore SDK 1.13, AR_TRACKING_FAILURE_REASON_NONE is returned in this case instead.

AR_TRACKING_FAILURE_REASON_EXCESSIVE_MOTION

Motion tracking lost due to excessive motion.

Ask the user to move the device more slowly.

AR_TRACKING_FAILURE_REASON_INSUFFICIENT_FEATURES

Motion tracking lost due to insufficient visual features.

Ask the user to move to a different area and to avoid blank walls and surfaces without detail.

AR_TRACKING_FAILURE_REASON_INSUFFICIENT_LIGHT

Motion tracking lost due to poor lighting conditions.

Ask the user to move to a more brightly lit area. On Android 12 (API level 31) or later, the user may have disabled camera access, causing ARCore to receive a blank camera feed.

AR_TRACKING_FAILURE_REASON_NONE

Indicates expected motion tracking behavior.

Always returned when ArCamera_getTrackingState is AR_TRACKING_STATE_TRACKING. When ArCamera_getTrackingState is AR_TRACKING_STATE_PAUSED, indicates that the session is initializing normally.

ArTrackingState

 ArTrackingState

Describes the tracking state of an ArTrackable, an ArAnchor or the ArCamera.

Properties
AR_TRACKING_STATE_PAUSED

ARCore has paused tracking this object, but may resume tracking it in the future.

This can happen if device tracking is lost, if the user enters a new space, or if the session is currently paused. When in this state, the positional properties of the object may be wildly inaccurate and should not be used.

AR_TRACKING_STATE_STOPPED

ARCore has stopped tracking this Trackable and will never resume tracking it.

AR_TRACKING_STATE_TRACKING

The object is currently tracked and its pose is current.