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

Quickstart for Android

Get started with targeting your ARCore Unity apps to Android.

This guide shows you how to set up your development environment and try out an ARCore sample app.

Requirements

Hardware

  • An ARCore supported device

  • A USB cable to connect your device to your development machine

Software

Get the ARCore SDK for Unity

  1. Download ARCore SDK for Unity 1.20.0 or later.
    The SDK is downloaded as arcore-unity-sdk-1.21.0.unitypackage.

Create a new project and import the SDK

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

  2. Unity 2019 only: Select Window > Package Manager and install the following packages:

    • Multiplayer HLAPI (required by the CloudAnchors sample)
    • XR Legacy Input Helpers (required by Instant Preview, which uses the TrackedPoseDriver)
  3. Import the ARCore SDK for Unity:

    1. Select Assets > Import Package > Custom Package.

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

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

Open the sample scene

  1. In the Unity Project window, you can find the HelloAR sample in:
    Assets/GoogleARCore/Examples/HelloAR/Scenes/.

Configure project settings

  1. Go to File > Build Settings to open the Build Settings window.
  2. Under Platform, select Android and click Switch Platform.
  3. Click Player Settings.
  4. In the Android settings tab, configure the following settings:
    Section Setting Configuration
    Other Settings Rendering Uncheck Auto Graphics API.
    If Vulkan is listed under Graphics APIs, remove it.
    Multithreaded Rendering Select this option to use multithreaded rendering.

    Note:
    • When building for Android, the Multithreaded Rendering option is supported in ARCore SDK for Unity 1.17.0 or later. However, when this option is enabled in Unity 2018.1 and earlier, using the front-facing (selfie) camera is not supported.
    • 3D assets may not always render correctly when an app places a high load on the rendering thread.
    Package Name Create a unique app ID using a Java package name format.
    For example, use com.example.helloAR.
    Scripting Backend When building for 64-bit devices, set the Scripting Backend to IL2CPP. See ARCore 64-bit requirement for more information.
    Target Architectures When building for 64-bit devices, select ARM64 (requires Scripting Backend set to IL2CPP). See ARCore 64-bit requirement for more information.
    Minimum API Level Select Android 7.0 'Nougat' (API Level 24) or higher.
    For AR Optional apps, the Minimum API level is 14.
    XR Settings ARCore Supported Enable this option.

Build and run the sample app

  1. Enable developer options and USB debugging on your device.

  2. Connect your device to your development machine.

  3. In the Unity Build Settings window, click Build and Run.
    Unity builds your project into an Android APK, installs it on your device, and launches it.

  4. Move your device around until ARCore starts detecting and visualizing planes.

  5. Tap a plane to put an Andy Android object on it.

  6. (Optional) Use Android logcat to view log messages or Android Device Monitor to analyze the device more comprehensively.

Next Steps