If you just switched to export your Android project using 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 instead of the old system, you may encounter build errors, especially if you are using additional Android libraries, or if you have added a custom AndroidManifest.xml.
The Android Gradle plug-inA 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 is much more picky than the old ADTAn Android project type that is no longer supported by Google and is considered obsolete. More info
See in Glossary/Ant system. It does not accept
anything it considers an error, whether it’s duplicate symbols, references to resources that don’t
exist, or a library project that sets the same attribute as the main application.
In most cases, fixing the problem involves editing an AndroidManifest.xml file; either the main one, or one from a library your project uses.
In a non-trivial project, or if the project has issues not described by the troubleshooting section below, export the project as a Gradle project (from Build Settings) and build from the command line. Building from the command line gives you more detailed error messages, and makes for a quicker turnaround when applying changes.
An AndroidManifest.xml file, either the main one or in a library, references a non-existing resource. Often it is the application icon or label string that is set by a library. This can happen if you have copied your main manifest to a library project without removing those references.
Remove the attribute from one of the Android Manifests – normally the one from the library.
The android:minSdkVersion
attribute is specified in the AndroidManifest.xml
file. It can be in the main manifest file, or in a file in one of the directories which Unity treats as Android libraries. .aar plugins shouldn’t cause this issue.
The solution is to remove the uses-sdk android:minSdkVersion
element from the main manifest and / or manifests in library directories. Instead, you should specify the minimum SDK version in the build.gradle
file instead. If you don’t have a custom Gradle template, Unity automatically handles this. If you do have a custom Gradle template, make sure the minSDK is specified in the defaultConfig
section of the template.
You have a file name collisionA collision occurs when the physics engine detects that the colliders of two GameObjects make contact or overlap, when at least one has a rigidbody component and is in motion. More info
See in Glossary between your main application and a library project, or between two
library projects. Keep in mind that all of the files are copied into the same 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 package.
You need to remove one of the files.
A library can not use the same Java package as the main application, or any other library.
Usually, you should change the package name of the library to something different. If the library contains a lot of code, it may be easier to change the main package name (from the Player settings).
A library can not freely override attributes from the main AndroidManifest.xml
file. Often this error is caused by a library setting the application icon or label string, similar to the Resource not found problem above.
Either remove the attribute from the library, or add a tools:replace attribute to your application tag, to indicate how the merge conflict should be resolved.
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.