Unable to merge android manifest unity

Unable to merge android manifests #1894

Comments

ghost commented Aug 27, 2017

I using Unity v5.4.1f1, when I want to build the APK file the following error occurs:

CommandInvokationFailure: Unable to merge android manifests. See the Console for more details.
/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/bin/java -Xmx2048M -Dcom.android.sdkmanager.toolsdir=»/Users/Jaime/android-sdks/tools» -Dfile.encoding=UTF8 -jar «/Applications/Unity/PlaybackEngines/AndroidPlayer/Tools/sdktools.jar» —

]
stdout[
Warning: [Temp/StagingArea/AndroidManifest-main.xml:12, /Users/Jaime/Documents/PROY_DIES/ProyectosUnity/Mars 9 ver Android TAPPX 1.25B/Temp/StagingArea/android-libraries/GooglePlay/AndroidManifest.xml:3] Main manifest has but library uses targetSdkVersion=’24’
[Temp/StagingArea/AndroidManifest-main.xml, /Users/Jaime/Documents/PROY_DIES/ProyectosUnity/Mars 9 ver Android TAPPX 1.25B/Temp/StagingArea/android-libraries/play-services-basement-11.0.4/AndroidManifest.xml:5] Skipping identical /manifest/application/meta-data[@name=com.google.android.gms.version] element.
]
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidSDKTools.RunCommandInternal (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidSDKTools.RunCommandSafe (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.HostView:OnGUI()

The text was updated successfully, but these errors were encountered:

Источник

Unable to merge android manifest unity

So when I try to build my application, Unity shows me this error message:

Attribute application@icon value=(@drawable/app_icon) from AndroidManifest-main.xml:10:16-49

is also present at AndroidManifest.xml:13:9-45 value=(@drawable/ic_launcher).

But when I change in the android manifest, I try to build again and the manifest returns as before, without the tools:replace.

I tried to fix the problem by removing the android Manifest in the project folder (except the hand) but it still does not work.

Can you help me ?? 🙁

Unable to merge android manifest

I am also having issues with building for Android, and I am getting the same errors in that Unity is telling me that it couldn’t merge the manifest files.

I’ve made sure that I have the appropriate SDK installed through the Android Studio program, and made sure to set my Android target API level to level 22 and changed the minimum to 19 in the manifest

I am getting two console errors:

F:\Local Unity\Vuforia\Temp\StagingArea\AndroidManifest-main.xml:10:83-141 Error: Attribute application@theme value=(@android:style/Theme.NoTitleBar.Fullscreen) from AndroidManifest-main.xml:10:83-141 is also present at AndroidManifest.xml:3:83-147 value=(@android:style/Theme.Black.NoTitleBar.Fullscreen). Suggestion: add ‘tools:replace=»android:theme»‘ to element at AndroidManifest-main.xml:10:3-31:17 to override. UnityEditor.HostView:OnGUI()

AndroidSDKToolsException: Unable to merge android manifests. See the Console for more details. UnityEditor.Android.AndroidSDKTools.DetectErrorsAndWarnings (System.String logMessages, System.String errorMsg) UnityEditor.Android.AndroidSDKTools.RunCommandInternal (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) UnityEditor.Android.AndroidSDKTools.RunCommandSafe (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) UnityEditor.Android.AndroidSDKTools.RunCommand (System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) UnityEditor.Android.AndroidSDKTools.RunCommand (System.String[] sdkToolCommand, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) UnityEditor.Android.AndroidSDKTools.RunCommand (System.String[] sdkToolCommand, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) UnityEditor.Android.AndroidSDKTools.MergeManifests (System.String target, System.String mainManifest, System.String[] libraryManifests, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit) UnityEditor.Android.PostProcessor.Tasks.GenerateManifest.MergeManifests (UnityEditor.Android.PostProcessor.PostProcessorContext context, System.String targetManifest, System.String mainManifest) UnityEditor.Android.PostProcessor.Tasks.GenerateManifest.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) UnityEditor.HostView:OnGUI()

I have the AndroidManifest file in my Assets/Plugins folder in my Unity project file, the one that you get from importing the vurforia unity package.

Читайте также:  Хороший счетчик калорий для андроид

Источник

Android Manifest

The Android Manifest is an XML file which contains important metadata about the Android app. This includes the package name, activity names, main activity (the entry point to the app), Android version support, hardware features support, permissions, and other configurations.

For more information about the Android Manifest file, see the Android Developer documentation on Android Manifests.

How Unity produces the Android Manifest

In Unity 2019.3 and newer versions, the Android 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 project that Unity generates has two template manifest files:

  1. LauncherManifest.xml — Located in the exported project, at root/launcher/src/main/AndroidManifest.xml. This file contains the app’s:
    • icons
    • name
    • starting activity and its Intents
    • install location
    • supported screen sizes
    • isGame setting
  2. LibraryManifest.xml — Located in the exported project at root/unityLibrary/src/main/AndroidManifest.xml. You can override this manifest with a custom_ AndroidManifest.xml_ that you add in the Plugins/Android folder. This file declares the:
    • Unity activity
    • permissions
    • theme used by the Unity activity
    • VR modes
    • VR performance
    • making the activity non-resizable (for VR)
    • setting max aspect ratio
    • reacting to configuration changes
    • orientations
    • launch modes
    • Android UI (User Interface) Allows a user to interact with your application. More info
      See in Glossary hardware acceleration
    • used features (like gamepad or graphics API)
    • notch support
    • initial window size
    • ability to resize the window

When Unity builds your app, it automatically generates the Android manifest files, following the steps below:

  1. Unity uses LibraryManifest.xml or AndroidManifest.xml as the main manifest.
  2. It then finds all of the Android manifests of your plug-ins 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 (.aar files and Android Libraries).
  3. It uses Google’s manifmerger class to merge plug-in manifests into the main manifest.
  4. Unity modifies the manifest files in the launcher and library modules. It automatically adds permissions, configuration options, features used, and other information.

Overriding the Android manifest

Although Unity generates a correct manifest for your app, you might want direct control over its contents.

To use an Android manifest you created outside of Unity, import your Android Manifest file to the following location: Assets/Plugins/Android/AndroidManifest.xml. This overrides the default LibraryManifest.xml.

In this situation, Unity merges the manifests of your Android libraries into your main manifest, and ensures that the resulting manifest’s configuration is correct. For full control of the manifest, including permissions, you must export the Project and modify the final manifest in Android Studio.

Читайте также:  Яндекс диск для планшета андроид

Note: Unity only supports the [launchMode — singleTask](https://developer.android.com/guide/topics/manifest/activity-element.html#lmode) launch mode.

Permissions

Unity automatically adds the necessary permissions to the manifest based on the Android Player Settings and Unity APIs that your app calls from the script. For example:

  • Network classes add the INTERNET permission
  • Using vibration (such as Handheld.Vibrate ) adds VIBRATE
  • The InternetReachability ] property adds ACCESS_NETWORK_STATE
  • Location APIs (such as LocationService ) adds ACCESS_FINE_LOCATION
  • WebCamTexture APIs add CAMERA A component which creates an image of a particular viewpoint in your scene. The output is either drawn to the screen or captured as a texture. More info
    See in Glossary permission
  • The Microphone class adds RECORD_AUDIO
  • NetworkDiscovery and NetworkTransport.SetMulticastLock add CHANGE_WIFI_MULTICAST_STATE

For more information about permissions, see Android developer documentation on Android Manifest Permissions.

If your plug-ins require a permission by declaring it in their manifests, Unity automatically adds the permission to the resulting Android manifest during the merge stage. All Unity APIs that plug-ins call also contribute to the permissions list.

Runtime permissions in Android 6.0 (Marshmallow)

If your app is running on a device with Android 6.0 (Marshmallow) or later and also targets Android API level 23 or higher, your app uses the Android Runtime Permission System.

The Android Runtime Permission System asks the user to grant permissions while the app is running, instead of when they first install the app. App users can usually grant or deny each permission when the app needs it while the app is running (for example, requesting camera permission before taking a picture). This allows an app to run with limited functionality without permissions. You can use the Android.Permission class in Unity to check whether the user granted or denied specific permissions. If a permission your app needs has been denied, you can inform the user why the app needs it and ask them to approve the permission. For more information, see documentation on Requesting Permissions.

Your app normally prompts the user to allow what Android calls “dangerous” permissions on its startup. For more information, see Android developer documentation on dangerous permissions. If you don’t want your app to ask for permissions on startup, you can add the following code to your manifest, in either the Application or Activity sections:

Note: This code suppresses the permission dialog the app shows on startup, but you must handle runtime permissions carefully to avoid crashes. This is an advanced method of dealing with runtime permissions.

For more information about the Runtime Permission System and handling permissions, see Android developer documentation on Requesting Permissions.

Examining the resulting Android manifest

To examine the final Android manifest that Unity generates for your app, open the Temp/StagingArea/AndroidManifest.xml file after you build your Project but before you close the Unity Editor.

The Manifest is stored in binary format in the output package (.apk). To check the contents of a Manifest inside an . 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 , you can use the Android Studio APK Analyzer, or another third-party tool such as Apktool.

  • Unity as a Library for Android added in 2019.3. NewIn20193
  • Added support for Android Runtime Permissions in 2018.3.
  • Updated functionality in 5.5
Читайте также:  Учет финансов для андроид с синхронизацией

Источник

Невозможно объединить манифесты Android

Я без проблем работал с сервисами Google Play. после добавления Admob я начинаю видеть эту проблему. Не знаю, в чем проблема. Я попытался найти это здесь, но не нашел рабочего решения. Не могли бы вы помочь?

2 ответа

Вот в чем проблема:

Определен в AndroidManifest.xml из каталога Assets\Plugins\Android\MainLibProj .

Затем снова как

В AndroidManifest.xml из каталога Assets\Plugins\Android .

Как видите, оба они содержат разные значения. Вот почему Unity не понимает, какой из них использовать.

Решение :

Сохраните значение android:value=»8115000″ и удалите значение android:value=»@integer/google_play_services_version» .

Для этого просто перейдите в Assets\Plugins\Android\MainLibProj , откройте AndroidManifest.xml файл, удалить

И сохранить . Создайте свой проект еще раз, и ваша проблема должна исчезнуть.

У меня была такая же проблема, потому что вы используете GamePlayServices, он также содержит файлы объявлений Google.

Загрузите последнюю версию подключаемого модуля Google Mobile Ads for unity по этой ссылке — https://github.com/googleads / googleads-mobile-unity

(Примечание — в этой папке нет файла .unitypackage, поэтому вам нужно скопировать папку с ресурсами из источника \ plugin \ и вставить ее в свой проект, заменив все файлы, если этого требует копир. А если вам нужно импортировать образец сцены, скопируйте активы из samples \ HelloWorld \ и вставьте его в свой проект.)

Источник

Unity ругается на AndroidManifest

Хотел подключить рекламу от Appodeal, но после установки их плагина при компиляции игры выходит ошибка:

Unable to merge Android Manifest. See the console for details.

CommandInvokationFailure: Unable to merge android manifests.
C:/Program Files/Java/jdk1.8.0_161\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir=»C:/Users/User/AppData/Local/Android/Sdk\tools» -Dfile.encoding=UTF8 -jar «D:\Unity3D\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar» —

Из-за таких ошибок, иногда хочется бросить свой проект нафиг. Кто в этом разбирается, прошу помочь. Благодарен!

Не создаётся AndroidManifest
Здравствуйте. Подскажите пожалуйста. Скачал eclipse, установил в него ADT, SDK. Создаю Android.

Редактирование AndroidManifest.xml
Всем привет! В каждом apk — приложении обязательно есть файл AndroidManifest.xml . Он, как.

Activity без AndroidManifest
Возможно ли подобное? Научился создавать «на лету» диалоги, подставляя xml и обработчики. Все.

AndroidManifest (Не редактируются uses-permission android)
Всем привет! Не могу удалить разрешения к доступам: интернету, телефонным контактам и т.д.. Нашел.

The activity ‘MainActivity’ is not declared in AndroidManifest.xml
В Android Studio перестал запускаться проект. Пишет «The activity ‘MainActivity’ is not declared.

На андроид вылетает missing adactivity with android.configchanges in androidmanifest.xml
постоянно вылетает missing adactivity with android.configchanges in androidmanifest.xml на.

Почему vk ругается на бесплатные хостинги? На какие не ругается?
Здравствуйте, Что нужно сделать, чтобы vk не ругался на бесплатный хостинг? Я нашёл отличный.

Источник

Оцените статью