While developing for Android using Unity, you could encounter a number of issues. Problems are often related to 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 or incorrect Project settingsA broad collection of settings which allow you to configure how Physics, Audio, Networking, Graphics, Input and many other areas of your project behave. More info
See in Glossary. This section outlines the most common scenarios and relavant troubleshooting advice.
Remove any native plug-insA platform-specific native code library that is created outside of Unity for use in Unity. Allows you can access features like OS calls and third-party code libraries that would otherwise not be available to Unity. More info
See in Glossary you have.
Disable stripping.
Use adb logcat
to get the crash report from your device. Consult the official Android Developer Logcat Command-Line Tool documentation for more information.
Ensure Settings > Developer Options > Don’t keep activities isn’t enabled on the device.
The video player is its own activity, and therefore regular game activity will be destroyed if the video player is activated.
If Unity cannot find an Android device connected to the system, check the following:
Make sure that your device is actually connected to your computer - check the USB cable and the sockets.
Make sure that your device has USB Debugging enabled in the Developer options. For more details, refer to the Android SDK/NDK Setup page.
Run the adb devices
command from the platform-tools
directory of your Android SDK installation and check the output.
If the output list is empty and you are using Windows, you may need to install the driver for ADBAn Android Debug Bridge (ADB). You can use an ADB to deploy an Android package (APK) manually after building. More info
See in Glossary devices. For more details, refer to the Android SDK/NDK Setup documentation.
If the list contains entries with the unauthorized label, you may need to authorize your computer on your device and give it permission to debug it. Check the device’s screen for the corresponding dialog.
If the list contains your device with the device label, build your Project in Unity again.
This error occurs when the Android Asset Packaging Tool (AAPT) fails. AAPT is used to build the intermediate Asset packagesA collection of files and data from Unity projects, or elements of projects, which are compressed and stored in one file, similar to Zip files, with the .unitypackage
extension. Asset packages are a handy way of sharing and re-using Unity projects and collections of assets. More info
See in Glossary during Android build. This issue is most often caused by missing resources or duplicate resources in your Android plug-ins.
Check the console message for more details - it should contain the IDs of the resources that are missing or duplicates. Fix the error in your plug-ins by either adding the missing resources/settings or removing the duplicate plug-ins.
The most likely cause for this issue is that one of your plug-ins has a manifest that is incompatible with the main Unity manifest.
Check the console message for more details on which attributes are conflicting, and fix the manifests accordingly.
See the Android Manifest documentation for more details on Android manifests.
The most likely cause for this issue is that you have a Java plug-in added twice. This results in duplicate classes when Unity tries to build a DEX (Dalvik Executable Format) file from all the compiled Java plug-ins. Check the console output for the list of duplicate entries, and fix the plug-ins.
If your console messages says “Too many references”, it means that the number of fields and methods exceeded the DEX limit of 64k. This usually happens when the number of plug-ins or plug-in resources is too high. Due to the way the references are generated, the limit could be hit with just a couple of large plug-ins.
There are several ways to handle this issue. One of these is by stripping the plug-ins. However, the quickest way to fix it is to switch to the Gradle build system, or export the Project and build it in Android Studio.
This error can be caused by:
Installing to an incompatible device.
Installing to a device running a version of Android lower than the Minimum API Level in your Player settings.
Check the console for the actual error code and output.
2017–05–25 Page published
Updated functionality in 5.5
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.