Use Android Libraries to reuse components across multiple applications, or build variations of one app with the same core components. Android Libraries compile into Android Archive (AAR) files that can be used as a dependencyIn the context of the Package Manager, a dependency is a specific package version (expressed in the form package_name@package_version
) that a project or another package requires in order to work. Projects and packages use the dependencies attribute in their manifests to define the set of packages they require. For projects, these are considered direct dependencies; for packages, these are indirect, or transitive, dependencies. More info
See in Glossary for an Android app module.
Android Archive (AAR) plug-insA set of code created outside of Unity that creates functionality in Unity. There are two kinds of plug-ins you can use in Unity: Managed plug-ins (managed .NET assemblies created with tools like Visual Studio) and Native plug-ins (platform-specific native code libraries). More info
See in Glossary are bundles that include compiled Java and native (C/C++) code, resources, and an Android Manifest. The .aar file itself is a .zip archive which contains all of the Assets. For more details, see Android Developer documentation on creating an Android Library.
To add an AAR plug-in to your Project, copy the .aar file anywhere within the Assets/Plugins/Android/libs path, then select it in Unity to open the Import Settings in the InspectorA Unity window that displays information about the currently selected GameObject, asset or project settings, allowing you to inspect and edit the values. More info
See in Glossary window. Enable the Android checkbox to mark this .aar file as compatible with Unity:
Android Library projects are similar to AAR plug-ins: they contain native and Java code, resources, and an Android Manifest. However, an Android Library is not a single archive file, but a directory with a special structure which contains all of the Assets. The easiest way to create an Android Library project is by creating a project of this type in Android Studio. For more details, see Android Developer documentation on creating an Android Library.
Android Library projects must have the .androidlib extension for Unity to support them. Add this extension to your library’s root folder name (for example, mylibrary.androidlib
), and place the folder in the Assets
folder of your Unity Project. Unity automatically includes all Android Libraries into the final GradleAn Android build system that automates several build processes. This automation means that many common build errors are less likely to occur. More info
See in Glossary project, and build them together with it, in the same way that Android Studio projects are built when they have multiple subprojects.
For more details, see Android Studio documentation on the Library module.
If you need to add Assets to your Unity app that should be copied as they are into the output package, import them into the Assets/Plugins/Android/assets
folder. These will be copied into the assets/
directory of your APKThe Android Package format output by Unity. An APK is automatically deployed to your device when you select File > Build & Run. More info
See in Glossary, and you can access them by calling the getAssets()
Android API from your Java code.
When you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer.
More information
These cookies enable the website to provide enhanced functionality and personalisation. They may be set by us or by third party providers whose services we have added to our pages. If you do not allow these cookies then some or all of these services may not function properly.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us to know which pages are the most and least popular and see how visitors move around the site. All information these cookies collect is aggregated and therefore anonymous. If you do not allow these cookies we will not know when you have visited our site, and will not be able to monitor its performance.
These cookies may be set through our site by our advertising partners. They may be used by those companies to build a profile of your interests and show you relevant adverts on other sites. They do not store directly personal information, but are based on uniquely identifying your browser and internet device. If you do not allow these cookies, you will experience less targeted advertising. Some 3rd party video providers do not allow video views without targeting cookies. If you are experiencing difficulty viewing a video, you will need to set your cookie preferences for targeting to yes if you wish to view videos from these providers. Unity does not control this.
These cookies are necessary for the website to function and cannot be switched off in our systems. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms. You can set your browser to block or alert you about these cookies, but some parts of the site will not then work. These cookies do not store any personally identifiable information.