Compile and Run EasyAR Android Samples

This article shows how to run EasyAR non-Unity Android samples.

If you want to setup EasyAR Android projects using EasyAR package, please read this instead.

Pre-Requirements

  • JDK 11

  • Android Studio 2020.3.1 or later (Android Studio samples)

  • Android NDK r23

It is recommended to install the latest version of Android Studio

Import sample to Android Studio

../_images/image21.png

You may need to wait Android Studio to finish download and configurations.

../_images/image22.png

There is no need to update Grade Plugin when it pops up, but you can update if you prefer.

Please note update Grade Plugin may require update Build Tools, if you meet any errors, follow the instructions given by Android Studio.

Setup NDK (c++ samples)

If you have not configured NDK for Android Studio before, you may see an error message like this

../_images/image23.png

Just click the link in error message and follow instructions, Android Studio will do the rest for you. Alternatively, you can put your local NDK into Android SDK and rename it to ndk-bundle.

Key

Find similar code in the samples as bellow, and follow instructions to set the key.

../_images/image24.png

Run

Now you can run the sample by clicking the following button

../_images/image25.png

For individual features, please refer to Guides . For example, refer to EasyAR Planar Image Tracking for planar image tracking.

260 character path limit on Windows

On Windows, if any file in the project (including temporary files generated in the build process) has a path of longer than 260 characters, Android Studio may fail the build. Reduce the directory path length to workaround this problem.