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.
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.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Is something described here not working as you expect it to? It might be a Known Issue. Please check with the Issue Tracker at issuetracker.unity3d.com.
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thanks for helping to make the Unity documentation better!