Google is committed to advancing racial equity for Black communities. See how.

Enable ARCore for Android

This page describes how to enable ARCore functionality in your Unity projects that target Android devices. To do this, you need to:

  1. Import the ARCore SDK for Unity
  2. Configure your app to be AR Required or AR Optional
  3. Make sure your app complies with ARCore's User Privacy Requirements

Google Play Services for AR

ARCore SDKs make AR features available on ARCore supported devices that have Google Play Services for AR (ARCore) installed.

Google Play Services for AR is automatically installed and kept up to date on the vast majority of supported devices.

Before starting an AR session, apps must:

  1. Check that ARCore is supported, by calling CheckApkAvailability.
  2. Check that Google Play Services for AR is installed and up to date, and that required ARCore device profile data has been downloaded, by calling Session.RequestApkInstallation(bool userRequested).

Import the ARCore SDK for Unity

  1. Open Unity and create a new 3D project.

  2. Install version specific packages.

    Unity 2020

    Select Window > Package Manager and install the following packages:

    • Multiplayer HLAPI (required by the Cloud Anchors sample)
    • XR Plugin Management (required by Instant Preview, which uses the TrackedPoseDriver)

    Unity 2019

    Select Window > Package Manager and install the following packages:

    • Multiplayer HLAPI (required by the Cloud Anchors sample)
    • XR Legacy Input Helpers (required by Instant Preview, which uses the TrackedPoseDriver)

    Unity 2018

    No additional packages are required. Proceed to the next step.

    Unity 2017

    No additional packages are required. Proceed to the next step.

  3. Import the ARCore SDK for Unity:

    1. Select Assets > Import Package > Custom Package.

    2. Select the arcore-unity-sdk-1.25.0.unitypackage that you downloaded.

    3. In the Importing Package dialog, make sure that all package options are selected and click Import.

In Unity's Project window, you should see both the SDK files and the HelloAR sample app in Assets/GoogleARCore/Examples/HelloAR/.

Configure your app to be AR Required or AR Optional

An app that supports AR features can be configured in two ways: AR Required and AR Optional. If you need help deciding which one to choose, see Publish AR Apps in the Google Play Store.

AR Required

To be usable, an AR Required app requires an ARCore Supported Device that has Google Play Services for AR installed on it.

  • The Google Play Store makes AR Required apps available only on devices that support ARCore.

  • When users install an AR Required app, the Google Play Store automatically installs Google Play Services for AR. However, your app must still perform additional runtime checks in case Google Play Services for AR must be updated or has been manually uninstalled, or ARCore device profile data is not up to date.

For more information, see Publishing AR Apps in the Google Play Store.

To make an app AR Required, follow these steps.

Unity 2020

  1. Open Edit > Project Settings. Select Google ARCore and verify that ARCore Required is checked.

  2. Set the appropriate Minimum API Level by clicking Edit > Project Settings > Player, and selecting the tab with the Android icon. Under Other Settings > Identification select a Minimum API Level that is 24 or higher.

Unity 2019

  1. Open Edit > Project Settings. Select Google ARCore and verify that ARCore Required is checked.

  2. Set the appropriate Minimum API Level by clicking Edit > Project Settings > Player, and selecting the tab with the Android icon. Under Other Settings > Identification select a Minimum API Level that is 24 or higher.

Unity 2018

  1. Open Edit > Project Settings. Select Google ARCore and verify that ARCore Required is checked.

  2. Set the appropriate Minimum API Level by clicking Edit > Project Settings > Player, and selecting the tab with the Android icon. Under Other Settings > Identification select a Minimum API Level that is 24 or higher.

Unity 2017

  1. Open Edit > Project Settings > Google ARCore, then verify that ARCore Required is checked.

  2. Set the appropriate Minimum API Level by clicking Edit > Project Settings > Player, and selecting the tab with the Android icon. Under Other Settings > Identification select a Minimum API Level that is 24 or higher.

Your app will automatically perform runtime checks to make sure that the device supports ARCore and has Google Play Services for AR installed and that ARCore device profile data is up to date. If Google Play Services for AR is not installed (possibly because it was removed by the user) or the version is too old, your app will prompt the user to install or update it. If ARCore device profile data is not up to date, your app will download and update it. If either install or update fails (possibly due to a network failure), Session.Status will return an error, and your app should handle the error and quit.

AR Optional

An AR Optional app has optional AR features, which are activated only on devices that has Google Play Services for AR installed.

  • AR Optional apps can be installed and run on devices that don't support ARCore.

  • When users install an AR Optional app, the Google Play Store will not automatically install Google Play Services for AR with the app.

To make an app AR Optional, follow these steps.

Unity 2020

  1. Open Edit > Project Settings. Select Google ARCore and uncheck ARCore Required.

  2. Set the appropriate Minimum API Level by clicking Edit > Project Settings > Player, and selecting the tab with the Android icon. Under Other Settings > Identification select a Minimum API Level that is 18 or higher.

Unity 2019

  1. Open Edit > Project Settings. Select Google ARCore and uncheck ARCore Required.

  2. Set the appropriate Minimum API Level by clicking Edit > Project Settings > Player, and selecting the tab with the Android icon. Under Other Settings > Identification select a Minimum API Level that is 18 or higher.

Unity 2018

  1. Open Edit > Project Settings. Select Google ARCore and uncheck ARCore Required.

  2. Set the appropriate Minimum API Level by clicking Edit > Project Settings > Player, and selecting the tab with the Android icon. Under Other Settings > Identification select a Minimum API Level that is 18 or higher.

Unity 2017

  1. Open Edit > Project Settings > Google ARCore and uncheck ARCore Required.

  2. Set the appropriate Minimum API Level by clicking Edit > Project Settings > Player, and selecting the tab with the Android icon. Under Other Settings > Identification select a Minimum API Level that is 18 or higher.

Perform runtime checks

When launched, your app must call Session.CheckApkAvailability() to check whether the device supports ARCore and, if so, whether Google Play Services for AR and ARCore device profile data are installed and up to date.

Your app should handle these conditions:

Condition Action
Device does not support ARCore. Hides AR-related functionality.
Device supports ARCore, but Google Play Services for AR and/or ARCore device profile data is not installed or out of date. Prompts the user to install or update Google Play Services for AR and/or ARCore device profile data by calling Session.RequestApkInstallation().
Device supports ARCore and Google Play Services for AR and ARCore device profile data is installed and up to date. Creates an ARCore Session and starts using ARCore.

User Privacy Requirements

Make sure your app complies with ARCore's User Privacy Requirements.

Next Steps

Read the code in the sample app and ARCore for Unity API reference.