ARCore Configuration¶
When Do I Need ARCore¶
EasyAR do not depend on ARCore to run, and all EasyAR features do not require ARCore to work. But when using some features, you may want to use ARCore motion tracking on devices supported.
About motion tracking: EasyAR motion tracking feature (MotionTracker) is similar with ARCore’s motion tracking in functionality. A typical ARSession will choose which one will be used in runtime according to configurations and device availabilities from the plugin.
Motion tracking is required when using features bellow, you can consider using ARCore when using these features if you want to use ARCore motion tracking on devices supported. EasyAR motion tracking will be used if ARCore is not enabled when using these features.
Motion tracking
Plane detection and put objects on the plane (EasyAR Motion Tracker or AR Foundation is required)
Sparse spatial map
Dense spatial map
Motion fusion
Cloud spatial map
Notice, on some devices like Nreal Eyewears, motion tracking is provided by the device itself, not from EasyAR or ARCore.
Motion tracking is not required when using features bellow only, you can disable ARCore check in the build process if desired.
Plane image tracking (not in motion fusion)
3D object tracking (not in motion fusion)
Cloud recognition
Multi target tracking
Surface tracking
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 handleAR 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 usingAR 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.
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.
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.
Go to Project Settings > Player > Android tab > Publishing Settings > Build, and select both:
Custom Main Gradle Template
Custom Launcher Gradle Template.
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.
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,
Change project settings to fix this, use IL2CPP for build and select ARM64.
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.
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.