Let's start with your own development environment.
Win7 x64
Unity5.2.2
Android Studio 2.3.2 (hereinafter referred to as)
JDK1.7
Again, create the project.
Create a new project in as
With empty activity
Test the Classes.jar in Unity under the Project Libs folder, and right-click the->add as Library
All kinds of changes inside, the last to build APK, publish the App-debug.aar file
Open this AAR file with an decompression program
Delete the Libs folder
Take this file and Androidmanifest file to the Unity project
Under the Assets/plugins/android folder
Release Android in Unity, note the package name and the package name of your as Project
The Unity Test Project I built was a very simple scenario where the camera looked at a few cubes
Process as above, but will report a lot of errors, to solve these problems will be the following actions.
First of all
When you create an Android project in as
The last page has an option: backwards compatibility (APPCOMPAT)
This option is not checked, my unity and AppCompat may have sworn revenge.
Second, the JDK version
I was 1.7 and would report the following
Failed to compile resources with the following parameters:-bootclasspath "/users/alex/development/adt-bundle-mac-x86_ 64-20131030/sdk/platforms/android-21/android.jar "-D"/users/alex/documents/development/unity/maze/maze/temp/ Stagingarea/bin/classes "-source 1.6-target 1.6-encoding UTF-8" Com/facebook/android/r.java "" Com/google/android/gms /r.java "
Such a mistake, on the stackoverflow of the people answer is to upgrade the JDK to 1.8
I did it, OK.
Finally, in the OnCreate method in Mainactivity, the second line of the statement
Setcontentview (R.layout.activity_main);
This line must be commented out, or install the APK run error exit
Here, our Unity Project can be successfully released as an Android apk.
This article is from the "under the Tree Beast" blog, please make sure to keep this source http://shuxiayeshou.blog.51cto.com/4452347/1932216
Unity and Android Issues