Unity releases Android version

Let me talk about my own experience first. It took about 10 hours in total. At first, I installed jre and Android stdio, and then I found that I wanted to install JDK and SDK, and then I went to install JDK and SDK. The installation of JDK went well, but the installation of SDK failed. The reason is unknown. The back is the SDK installed with Android stdio. When I finally released it, I stepped on some pits. Well, these are for myself. Here are the highlights:

1. It is JDK and SDK to be installed, not Jre and Android stdio. When installing JDK, Jre will be installed together, and Android stdio should not be installed if it is not necessary;

2. Pay attention to the version. If the JDK is installed with version 8, don't install the version above 8. Unity does not support it; the latest version of the SDK must be installed with Android stdio, and the old version can be installed, because the latest SDK will report an error when Android is released in Unity. Tools ( folder) is missing something, still use the old version of Tools;

3. If the SDK Manager cannot be opened, if it cannot be solved, just use Android stdio to install the SDK, and then change the old version of Tools to the target directory;

4. If you encounter other problems, Baidu. (You can also ask me if I know)

The above is written by myself, the following is the reprinted content, a very detailed tutorial, the original address: the original address below


First statement: Unity version 5.6.3f1


       When I tried to use Qualcomm for AR development in Unity recently, I needed to release the project file to the Android platform. I encountered some problems. I read some information on the Internet and stepped on some pits. Now I have concluded that I hope that the same developers will encounter It can be avoided then.

       If you have any questions, please leave a comment and I will answer it as soon as I see it.


The construction of the Android development environment is divided into the following four steps:

The first step is to install JDK;

The second step, install Eclipse;

The third step, download and install the Android SDK;

The fourth step is to publish to the Android platform in Unity.


Install JDK

Official website : http://www.Oracle.com/technetwork/Java/javase/downloads/index.html _ _

Just follow these steps:

( 1 ) Click on any one of the arrows in the figure.

 

(2) Accept

 

(3) Find the JDK version suitable for your computer system and click to download

 

(4) After choosing the path and installing it, note: it cannot be saved in the Chinese path .

(5) Setting of variable environment: My Computer /Computer - Properties - Advanced System Settings - Environment Variables.

1. Create a new system environment variable, the variable name is JAVA_HOME, and the variable value is the installation path of the JDK

 

2. Find Path in the system variable and add ;%JAVA_HOME%\bin; %JAVA_HOME%\jre\bin to the variable value

Note: When adding at the end of the variable, you need to add a semicolon ;

③. Check whether the configuration is successful. Open a command line window and enter javac -version. If the installation is successful, you will see the oracle  JDK version number, as shown in the following figure:

 

 

Install Eclipse

Official website: http://www.eclipse.org/downloads/

1. Download Eclipse, select Eclipse IDE for  Java EE  Developers, and select the 32-bit or 64-bit installation package according to your system.

2. Unzip the downloaded installation package to the location you want to get the effect as shown:

 

3. Double-click eclipse/eclipse.exe. Select the storage location of the workspace by yourself, if the following icon appears, the installation is successful. If not, please check whether the JDK is installed and configured correctly in step 1.

 

 

 

Download and install the Android SDK 

Official website (can be selected over the wall): http://developer.android.com/sdk/index.html

Unable to overturn the wall option: http://www.androiddevtools.cn/

Or 360 Security Guard - 360 Software Manager - Programming Development - Search.

(The second method is used as an example to download below)

1. Download Android SDK Tools

First find the SDK Tools and download the latest version. Select zip and extract it to the target path location.

 

 

2. Double-click "SDK Manager" to start SDK Manager

①, Tools, check the icon option to download.

 

②. Any choice of API, considering the principle of backward compatibility, you can download the latest API.

③、Select all Extras

 

Note: If you cannot download, the following prompt will appear

 

At this time, use the Android SDK online update mirror server to download and install:

1. Mirror server address of Beijing University of Chemical Technology:

IPv4: ubuntu.buct.edu.cn/ Port: 80

IPv4: ubuntu.buct.cn/ port: 80

IPv6: ubuntu.buct6.edu.cn/ Port: 80

2. The mirror server address of Dalian Neusoft Institute of Information:

mirrors.neusoft.edu.cn Port: 80

3. Zhengzhou University Open Source Mirror Station:

mirrors.zzu.edu.cn Port: 80

Instructions:

Start the Android SDK Manager, open the main interface, select "Tools", "Options..." in turn, and the "Android SDK Manager - Settings" window will pop up;

 

In the " Android SDK Manager - Settings" window, fill in the above mirror server address (excluding http://, as shown below) and port in the "HTTP Proxy Server" and "HTTP Proxy Port" input boxes, and select "Force" https://... sources to be fetched using http://..." checkbox. After setting, click the "Close" button to close the "Android SDK Manager - Settings" window and return to the main interface;

Select " Packages", "Reload" in turn.

 

3. Set environment variables

①. Create a new system environment variable, the variable name is ANDROID_SDK_HOME, and the variable value is your SDK installation path

 

②Add %ANDROID_SDK_HOME%\platform-tools;%ANDROID_SDK_HOME%\tools to the Path environment variable.

③. Check whether the configuration is successful. Open a command line window and enter adb. The configuration is successful if the content shown in the following figure appears:

 

Publish to Android platform in Unity

①. In the publishing interface, you need to click on Android-Support-for-Editor to download, and then the following interface will appear:

 

②. Configure the installation paths of SDK and JDK in Unity.

Edit—Preferences—External Tools—Configure related paths

 

③、File—Build Settings—Player Settings

 

The parameters of step 3 are introduced:

Company Name
Product Name
Default Icon (apk icon): optional 

NOTE: The following errors may occur at this point

 

Modification method: modify the original default value.

Set the value of the Build Indentifier property to "com.aaa.bbb" format .

The operations are as follows: Edit Project Settings Player — Modify property values

 

At this point, you can republish.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326659586&siteId=291194637