Troubleshooting Android development
Reporting crash bugs under Android
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.
Specific problems
Resource not found
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 App Manifests – normally the one from the library.
MinSDK in Manifest
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.
Duplicate files in APK
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.
Colliding package names
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).
Colliding attributes
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.
Troubleshooting Android development
Reporting crash bugs under Android
Содержание
- Gradle troubleshooting
- Specific problems
- Resource not found
- MinSDK in Manifest
- Duplicate files in APK
- Colliding package names
- Colliding attributes
- Gradle troubleshooting
- Specific problems
- Resource not found
- MinSDK in Manifest
- Duplicate files in APK
- Colliding package names
- Colliding attributes
- Gradle troubleshooting
- Specific problems
- Resource not found
- MinSDK in Manifest
- Duplicate files in APK
- Colliding package names
- Colliding attributes
- Gradle troubleshooting
- Specific problems
- Resource not found
- MinSDK in Manifest
- Duplicate files in APK
- Colliding package names
- Colliding attributes
Gradle troubleshooting
If you just switched to export your Android project using Gradle 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-in is much more picky than the old ADT/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.
Specific problems
Resource not found
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.
MinSDK in Manifest
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.
Duplicate files in APK
You have a file name collision 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 APK package.
You need to remove one of the files.
Colliding package names
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).
Colliding attributes
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.
Источник
Gradle troubleshooting
If you just switched to export your Android project using Gradle An 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-in A 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 ADT An 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.
Specific problems
Resource not found
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.
MinSDK in Manifest
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.
Duplicate files in APK
You have a file name collision A 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 APK The 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.
Colliding package names
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).
Colliding attributes
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.
Источник
Gradle troubleshooting
If you just switched to export your Android project using Gradle 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-in is much more picky than the old ADT/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.
Specific problems
Resource not found
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.
MinSDK in Manifest
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.
Duplicate files in APK
You have a file name collision 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 APK package.
You need to remove one of the files.
Colliding package names
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).
Colliding attributes
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.
Источник
Gradle troubleshooting
If you just switched to export your Android project using Gradle An 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-in A 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 ADT An 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.
Specific problems
Resource not found
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 App Manifests – normally the one from the library.
MinSDK in Manifest
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.
Duplicate files in APK
You have a file name collision A 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 APK The 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.
Colliding package names
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).
Colliding attributes
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.
Источник
Если вы только что перешли на экспорт своего проекта Android с помощью Gradleсистемы сборки Android, которая автоматизирует несколько процессов сборки. Эта автоматизация означает, что вероятность возникновения многих распространенных ошибок сборки снижается. Подробнее
Смотрите в Словарь вместо старой системы, вы можете столкнуться с ошибками сборки, особенно если вы используете дополнительные библиотеки Android или добавили собственный файл AndroidManifest.xml.
Android Gradle подключаемый модульНабор кода, созданный вне Unity, который создает функциональные возможности в Unity. В Unity можно использовать два типа подключаемых модулей: управляемые подключаемые модули (управляемые сборки .NET, созданные с помощью таких инструментов, как Visual Studio) и собственные подключаемые модули (библиотеки собственного кода для конкретной платформы). Подробнее
См. в Словарь гораздо более требователен, чем старый ADTТип проекта Android, который больше не поддерживается Google и считается устаревшим. Подробнее
См. в системе Словарь/Ant. Он не принимает
все, что он считает ошибкой, будь то повторяющиеся символы, ссылки на ресурсы, которые не
существует или проект библиотеки, который устанавливает тот же атрибут, что и основное приложение.
В большинстве случаев для устранения проблемы необходимо отредактировать файл AndroidManifest.xml; либо основной
один или один из библиотеки, которую использует ваш проект.
В нетривиальном проекте или если в проекте есть проблемы, не описанные в разделе по устранению неполадок.
ниже экспортируйте проект как проект Gradle (из Настройки сборки) и выполните сборку из командной строки. Сборка из командной строки дает более подробные сообщения об ошибках и ускоряет применение изменений.
Особые проблемы
Resource not found
Файл AndroidManifest.xml, либо основной, либо в библиотеке, ссылается на несуществующий
ресурс. Часто это значок приложения или строка метки, устанавливаемая библиотекой. Это может
произойти, если вы скопировали свой основной манифест в проект библиотеки, не удаляя эти ссылки.
Удалите атрибут из одного из манифестов приложений Android — обычно из библиотеки.
MinSDK в манифесте
Атрибут android:minSdkVersion
указан в файле AndroidManifest.xml
. Это может быть основной файл манифеста или файл в одном из каталогов, которые Unity рассматривает как библиотеки Android. Плагины .aar не должны вызывать эту проблему.
Решение состоит в том, чтобы удалить элемент uses-sdk android:minSdkVersion
из основного манифеста и/или манифестов в каталогах библиотек. Вместо этого следует указать минимальную версию SDK в файле build.gradle
. Если у вас нет собственного шаблона Gradle, Unity сделает это автоматически. Если у вас есть собственный шаблон Gradle, убедитесь, что minSDK указан в разделе defaultConfig
шаблона.
Повторяющиеся файлы в APK
У вас есть имя файла collisionСтолкновение происходит, когда физический движок обнаруживает, что коллайдеры двух игровых объектов соприкасаются или перекрываются. , когда хотя бы один имеет компонент Rigidbody и находится в движении. Подробнее
Посмотрите в Словарь между вашим основным приложением и проектом библиотеки или между двумя
библиотечные проекты. Имейте в виду, что все файлы копируются в один и тот же формат APKAndroid Package, выводимый Unity. APK автоматически развертывается на вашем устройстве, когда вы выбираете «Файл» > «Сборка и запуск». Подробнее
См. в пакете Словарь.
Вам нужно удалить один из файлов.
Colliding package names
Библиотека не может использовать тот же пакет Java, что и основное приложение, или любую другую библиотеку.
Обычно следует изменить имя пакета библиотеки на другое. Если библиотека
содержит много кода, может быть проще изменить имя основного пакета (в настройках Player).
Colliding attributes
Библиотека не может свободно переопределять атрибуты из основного файла AndroidManifest.xml
. Часто эта ошибка возникает из-за того, что библиотека устанавливает значок приложения или строку метки, как и в случае с проблемой Ресурс не найден выше.
Либо удалите атрибут из библиотеки, либо добавьте атрибут tools:replace в свой
Тег application, чтобы указать, как следует разрешать конфликт слияния.
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.
Specific problems
Resource not found
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.
Duplicate files in APK
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.
Colliding package names
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).
Colliding attributes
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: