ARCore Configuration

When Do I Need ARCore

ARCore offers motion tracking capability on some Android devices. Please read Motion Tracking and EasyAR Features for the relationship between EasyAR and motion tracking, and is ARCore needed and when.

Choosing ARCore SDK

You can change ARCore SDK option according to how you use ARCore.

  • AR Foundation Or Optional: Either ARCore SDK distributed with EasyAR or AR Foundation will be included in the build according to the settings of ARCore XR Plugin. This option is suggested for most cases, it will handle AR Foundation automatically.

  • Optional: ARCore features are activated only on ARCore supported devices that have Google Play Services for AR installed.

  • Required: Your app will require an ARCore Supported Device that has Google Play Services for AR installed on it.

  • External: Use this option if you are using AR Foundation or other ARCore SDK distributions, so that ARCore SDK distributed with EasyAR will not be used. You can also use this option to fully exclude ARCore SDK to be included in you app.

../_images/image_g4_1.png

You can read Google’s instructions for more details about Optional and Required and configurations required for your app to submit to Play Store.

Use ARCore SDK distributed in the Plugin

ARCore libraries and settings are already inside EasyAR Sense Unity Plugin. It is still required to install Google Play Services for AR on the device though.

EasyAR’s ARCore wrapper using ARCore SDK distributed with EasyAR does NOT require GLES3, in opposite to ARCore XR Plugin used by AR Foundation . But we are not exporting rich features from ARCore . If you desire to use features like plane detection when using ARCore, it is still suggested to use AR Foundation .

Gradle 5.6.4 or later must be used in the build process for ARCore-enabled apps. The following error messages will pop up if Gradle version is too low, and build will fail if you choose to contine.

../_images/image_g4_15.png

The default Gradle version from Unity 2019.4 does not satisfy with the requirement, you need to configuire your projects according to bellow instructions. Gradel version should also satisfy with the requirement if you use custom Gradle in another Unity version.

Unity 2019.4

Please refer to bellow instructions or Google’s instructions for updating your project’s Gradle version.

Go to Preferences > External Tools > Android > Gradle, and set the custom Gradle to Gradle 5.6.4 or later. See Gradle build tool for downloads.

../_images/image_g4_13.png

Go to Project Settings > Player > Android tab > Publishing Settings > Build, and select both:

  1. Custom Main Gradle Template

  2. Custom Launcher Gradle Template.

../_images/image_g4_14.png

Apply the following changes to both generated files:

  • Assets/Plugins/Android/mainTemplate.gradle

  • Assets/Plugins/Android/launcherTemplate.gradle

If present, remove the following comment at the top of the file:

// GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN

Insert the following lines at the top of the file:

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        // Must be Android Gradle Plugin 3.6.0 or later. For a list of
        // compatible Gradle versions refer to:
        // https://developer.android.com/studio/releases/gradle-plugin
        classpath 'com.android.tools.build:gradle:3.6.0'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        flatDir {
            dirs 'libs'
        }
    }
}

If you really do not use ARCore, you can choose Continue and disable ARCore , or select Disable AR Core option, which will turn off checks in the build process. Notification message will pop up at runtime if you continue to use EasyAR ARCore wrapper (including automatic availability checks when it is in the scene) when ARCore is disabled.

../_images/image_g4_10.png

Target Architecture

ARCore will not work correctly on arm64 devices with armv7 only build according to Google’s policy. If you do not select ARM64, a warning message will pop up in the build process,

../_images/image_g4_11.png

Change project settings to fix this, use IL2CPP for build and select ARM64.

../_images/image_g4_6.png

If you really need to disable the warning, you can choose Continue and don't warn me again or turn off Verify 32bit Only AR Core When Build option, which will turn off checks in the build process. Tuning off this check will only close warnings in the build process, but errors may happen in runtime on some devices, including crash or black screen or others.

../_images/image_g4_12.png

Use ARCore SDK distributed in AR Foundation

If you want to use ARCore SDK from AR Foundation, you can reference Google’s instructions for configuration. ARCore SDK option require to be AR Foundation Or Optional or External in this case.

Use other ARCore SDK

If you want to use ARCore SDK from other plugins or projects, you need to read their instructions for configuration. ARCore SDK option require to be External in this case.