Setting Up Unity Editor for Android AR App Development: A Step-by-Step Guide
Published: 2023-11-05 15:56:56

Unity, the powerful real-time 3D development engine, empowers a collaborative effort between artists, designers, and developers to craft immersive and interactive experiences. In this article, we will guide you through the process of setting up the Unity editor to develop Augmented Reality (AR) applications for Android devices.

Let's dive into the steps:

**Launch Unity Hub and Create a New Project:**

- Open Unity Hub and click on "New Project."
- Select the "3D Core" template and give your project a name.
- Click "Create Project" and allow Unity to initialize your project.

![Creating new project](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ubkcnbmfwwvzfdk50jol.png)

**Configure Build Settings:**

- Navigate to "File > Build Settings."
- Choose "Android" as your target platform and click "Switch Platform."

![Configure Build Settings](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0d23igdx4ouclm52proo.png)


**Enable Unity Registry:**

- Head to "Windows > Package Manager."
- Ensure that "Unity Registry" is checked.

![Enable Unity Registry:](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ijiqk5atd2859adlmrkt.png)

**Install AR Foundation and Google AR Core XR Plugin:**

- Search for "AR Foundation" and install it.
- Similarly, install the "Google AR Core XR Plugin."

![Install AR Foundation and Google AR Core XR Plugin](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tqaq13lthpniaufiuqz6.png)

**Project Settings:**

- Go to "Edit > Project Settings."
- Select "Player" from the left-side menu.
- Provide your company name and product name.


![Project Settings](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jc2hxfd5rofk1ws3gai2.png)

**Adjust Graphics Settings:**

- In the same window, navigate to "Other Settings."
- Uncheck "Auto Graphics API" and remove "Vulkan" from the Graphics API list.

![Adjust Graphics Settings](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tlt3ae2w1mjioaov5r63.png)

**Set Minimum API Level:**

- Ensure that the "Minimum API Level" is set to "Android 7.0 - Nougat" (API level 24).

![Set Minimum API Level](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/15qs437a4111rhfvuosf.png)

**Configure Target Architecture:**

- In the same window, configure the "Scripting Backend" to IL2CPP.
- Select the "Target Architectures" option and choose "ARM64."


![Configure Target Architecture](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mil9xmfaq8hb8a1f8ap6.png)

**Enable XR Plugin for AR:**

- In the Project Settings window, select "XR Plugin Management."
- Check "Google AR Core" to enable it.

![Enable XR Plugin for AR](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ubu1t8cnwffjcjsbnm9v.png)

**Prepare the Scene:**

- Close the Project Settings window.
- Delete the "Main Camera" from the Hierarchy.


![Prepare the Scene](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kj9pl4zzbbkd79bc62cv.png)

**Set Up XR Components:**

- Right-click on the Hierarchy panel.
- Select "XR > AR Session."


![Set Up XR Components](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/73y4slcgpgyfey74v34l.png)

**Add XR Origin:**

- Right-click on the Hierarchy again.
- Select "XR > XR Origin."


![Add XR Origin](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kza5aoz1qk1w67pcxhhb.png)

**Add Scenes to Build Settings:**

- Go to "File > Build Settings."
- In the Build Settings window, locate the "Scenes In Build" section.
- Drag and drop your scene from the Hierarchy panel to add it to the list of scenes to build.

![Add Scenes to Build Settings](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r0nj518ycl0von9otavg.png)



With these steps completed, your fundamental setup for developing AR applications on Android devices is ready. You are now well-prepared to proceed with your AR development endeavors.