[JAVA] [Unity] Android development environment construction procedure

** Introduction **

This article describes the steps to build a ** Android ** development environment with ** Unity2018 **. I wrote this because I learned that Android Build Support alone cannot build ** .apk **.

** Execution environment **

We have confirmed the operation in the following environment.

procedure

** 1. Installing the JDK **

Download the JDK (Java Development Kit) from the official Oracle website. http://www.oracle.com/technetwork/java/javase/downloads/index.html

Run the downloaded exe with administrator privileges to install it. Make a note of the folder where you installed the JDK.

Pass the path ** JAVA_HOME ** for use with Unity.

Control Panel> System and Security> System Click Advanced System Settings from to open the system properties.

** Environment Variables> System Variables> New **

--Variable name: JAVA_HOME --Value: Folder where you installed the JDK

Set to.

At this point, restart your PC once.

** 2. Install Android Studio **

Then download and install Android Studio. https://developer.android.com/studio/?hl=ja

The reason for downloading the entire Android Studio instead of the SDK alone is This is because Android Studio comes with ** Android SDK Manager **.

If you want to check the operation on the actual smartphone, launch Android Stuido and Click Configure> SDK Manager at the bottom right of the screen and install the one that corresponds to your device's OS.

sdk-config.png

You can find the Android SDK path in the SDK Manager.

sdk-manager.png

** 3. Add Android Build Support to Unity **

Launch Unity Hub and open the Install tab. Click ... for the version of Unity to which you want to add Android Build Support. Select Add Component for modal display.

Check Android Build Support in Platforms and click Done. The download and installation will start, so wait until it finishes.

** 4. Build the .apk file **

Launch the Unity project.

First, pass the JDK and Android SDK paths through Unity. Open Unity Preference from ʻEdit> Preference`. Open the Extra tools tab and set the respective paths for the Android JDK and SDK.

If the environment variables are set properly, pressing the Browse button will Select Yes when Unity asks if you want to set a default path. If you are not asked, set the path confirmed in ** 1. Install JDK ** and ** 2. Install Android Studio **.

extra-tools.png

Then open File> Build Setting. Select Android in Platform and click Switch Platform.

build-setting.png

Click Player Setting to the right of Switch Platform. The Inspector will open, so set the Package Name in Other Settings. If you leave the default, the build will fail. build-setting.png

Let's actually build it.

Build Setting Click the Build button at the bottom right.

You can choose the output folder and the .apk file name as you like. It will take some time, so wait until the build is complete.

** Summary **

To build a ** .apk ** file in Unity for Android devices You need ** JDK ** and ** Android SDK ** in addition to ** Android Build Support **.

Recommended Posts

[Unity] Android development environment construction procedure
CentOS8 + Anaconda + Django development environment construction procedure
java development environment construction
Wordpress local environment construction & development procedure with Docker
Rails6 development environment construction [Mac]
Environment construction for Servlet application development
[Procedure 1 for beginners] Ruby on Rails: Construction of development environment
Rails on Docker environment construction procedure
CentOS8 + Anaconda 4.9.2 + jupyterhub environment construction procedure
Build Unity development environment on docker
[Processing x Java] Construction of development environment
Laravel development environment construction with Docker (Mac)
Sapper × Go (echo) × Docker development environment construction
Universal Robotics UR Caps development environment construction
Java development environment construction memo on Mac
[Docker] Development environment construction Rails6 / Ruby2.7 / MySQL8
Spring Boot + Docker Java development environment construction
[Java] Environment construction
Java environment construction
Java development environment
Android Development App_Preparation
[Spring] Environment construction
Docker environment construction
[Jakarta EE 8 application development with Gradle] 1. Environment construction
Environment construction procedure for using PowerMock with JUnit
Android application development using Unity + ARCore on Ubuntu
JAVA + STS (Spring Tool Suite) environment construction procedure
Development environment construction using IntelliJ IDEA + Maven + Tomcat 9
A reminder of Docker and development environment construction
Ruby on Rails development environment construction on M1 Mac
Django development environment construction using Docker-compose (personal memorandum)
WebSphere Liberty for Windows development environment maintenance procedure
[Environment construction] Eclipse installation
[Environment construction] Ruby on Rails 5.2 system development environment construction [within 1 hour]
Introduction to Slay the Spire Mod Development (2) Development Environment Construction
[Flutter] Ubuntu 20.04 environment construction
Java development environment memo
BEAR application Docker development environment construction example (docker-sync, Mutagen)
Android development link summary
Server construction procedure Ubuntu18.04 server
Stable development environment construction manual for "Rails6" with "Docker-compose"
TDD study # 1 environment construction & first test-driven development (July 6th, 2020)
[Java] Environment construction procedure for developing struts 1.3 with Eclipse
Circle CI environment construction
Android application development preparation 7/15
[Environment construction] Build a Java development environment with VS Code!
Java + Spring development environment construction with VirtualBox + Ubuntu (Xfce4)
Android development reference site
Web application development environment construction in Java (for inexperienced people)
Android environment construction that even monkeys can understand [React Native]
[Environment construction] Get the Ruby on Rails 6 development environment within 1 hour
Java web application development environment construction with VS Code (struts2)
Rails application development environment construction with Docker [Docker, Rails, Puma, Nginx, MySQL]
Create a Java and JavaScript team development environment (gradle environment construction)
[Java development environment construction] Install OpenJDK 11 (Java 11) on macOS with Homebrew.
iOS engineer starts Android development
[Spring Boot] Environment construction (macOS)
WSL2 + VSCode + Docker development environment
Rails engineer environment construction ruby2.7.1
EC-CUBE4 environment construction (local edition)
Android app personal development kickoff