How to add dependent Android engineering to the Unity3d project

Source: Internet
Author: User

Recently busy with the platform, need to access a variety of Android Platform SDK to publish. When the SDK was encountered such a situation, a bit of trouble, so record.

Some SDK access is to provide a jar package, so that the jar can be easily made into Android plugin, added to the Unity project, packaged into the APK output.

And there are some SDKs that provide a Lib project. In the documentation provided by the SDK, it is added in the Android project by adding dependencies. But for unity works, this is a bit different.

After many tests, steps are required:

1. Add the entire project catalog "Note 1" of the SDK project to the PLUGINS/ANDROID/%SDK name% directory

2. Also export the jar package and place the jar package in the Plugins/android/libs directory.

3. You can then choose how to make Android plugin, or call it directly in Unity3d.

"Note 1: The content contains: res/directory libs/directory assets/directory androidmanifest.xml. Classpath project.properties. Project Proguard-project.txt and others, depending on the situation "

Describe a strange phenomenon that was encountered during the test. In the above steps, if you skip step 2, use Unity3d to generate the APK directly (case a), and export the Eclipse Project, and then use Ecliipse to generate the APK (case b), there will be two different situations. In case a, if you invoke the interface of the SDK, you receive an ClassNotFound exception, and condition B can pass normally. By looking at the Unity Engineering/temp/stagingarea/Directory, it is assumed that unity is only processing the resource files under the PLUGINS/ANDROID/%SDK name% directory, while the Java files in the SRC directory are not processed.

How to add dependent Android engineering to the Unity3d project

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.