Compile and Run EasyAR Unity Samples

This article shows how to run EasyAR unity samples.

If you want to setup EasyAR Unity projects using EasyAR.unitypackage, please read this instead.

Pre-Requirements

  • Unity 4.6 or later

  • (If target for Android) Android SDK with Build Tools at least version 23.0.1

  • (If target for iOS) iPhone or iPad device, or other real iOS devices (EasyAR do not support running on the simulator)

Open Sample

First you need to open unity sample project and open the scene in the sample.

Unity 4 is like bellow,

../_images/image41.png

And Unity 5 like this,

../_images/image42.png

Additional for Unity 5, after open the project, follow Unity instructions to upgrade the project, then you can use it with no difference compared to Unity 4.

../_images/image43.png

Enter Key

Find "EasyAR" object and Enter "Key" in the inspector. Initialize will fail if a valid key is not provided.

../_images/image44.png ../_images/image45.png

Follow the instructions in the TextArea to fill the key.

../_images/image46.png

All is done! You can now run the Unity sample on all platforms including Windows/Mac/Android/iOS.

XCode configure

If you are using latest Unity, this step is automatically done by Unity.

When you are generating iOS apps, after the automatic build step which put everything from Unity to XCode, you need one more step to make all things work.

XCode 6.x: add libc++.dylib into linker libraries.

../_images/image47.png

XCode 7.x or later: add libc++.tbd into linker libraries. And Set Enable Bitcode to NO .

../_images/image48.png ../_images/image49.png

XCode configure for EasyAR SDK Pro

Add Accelerate.framework if you are using EasyAR SDK Pro samples.

../_images/image40.png

iOS Privacy Settings

Some privacy settings are required on iOS.

To use camera, add Privacy - Camera Usage Description,

../_images/image55.png

To use screen recording feature, add Privacy - Microphone Usage Description,

../_images/image56.png

iOS arm64 Support

EasyAR SDK support iOS arm64 build from the first public release of EasyAR SDK 1.0.

Starting from EasyAR SDK 2.1.0, all Unity samples have IL2CPP option turned on by default.

If you are using older versions of EasyAR SDK samples, you need to manually turn on IL2CPP in Player Settings.

../_images/image57.png

And change the architecture to Universal or arm64,

../_images/image58.png

If you are using some older version of Unity, you may meet this compile error in XCode,

../_images/image59.png

It is a Unity bug fixed in newer versions of Unity. It is suggested to upgrade your Unity, or just remove the word NORETURN like this.

../_images/image510.png

Android IL2CPP

IL2CPP support for Android is not included in the official EasyAR Unity Plugin, we will add support in later versions. But if you are writing your own EasyAR Plugin for Unity, you can always enable IL2CPP support.