Unity and Android Issues

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.