Search Issue Tracker

Won't Fix

Votes

0

Found in

5.5.4p1

Issue ID

924792

Regression

No

[Android] Unity fails merging Android manifest with sdk tools 26.0.2

Mobile

-

Reproduction steps:
1) Download and open attached project
2) Press Build and run
-- Notice that build fails with errors:

Error: Error while saving blame file, build will continue
Error: The prefix "tools" for attribute "tools:overrideLibrary" associated with an element type "uses-sdk" is not bound.

UnityEditor.HostView:OnGUI()

and

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, <...> (full error pasted in edit section)

Note: This reproduces only with 26.0.1 and 26.0.2 (currently newest) versions of sdk tools

Reproduced with:
2017.2.0b1, 2017.1.0f1, 5.6.1p2, 5.5.4p1, 5.4.5p3

RESOLUTION: WONTFIX. The issue is caused by a bug in the project. Specifically, Assets/Plugins/Android/AndroidManifest.xml is invalid and broken. The exact issue is that the manifest lacks xmlns:tools="http://schemas.android.com/tools&quot; namespace declaration and thus the new manifest merger tool from 26.0.2 fails to merge it with another manifest (specifically support-v4-25.2.0.aar), which uses the tools XML namespace.

Comments (39)

  1. sebt955

    Jan 16, 2023 12:51

    Unity has been reported to have issues merging Android manifests when using SDK Tools version 26.0.2. They recommend using SDK Tools version 25.2.5 instead.

  2. Vikramsingh123

    Aug 06, 2021 08:19

    <a href="https://issuetracker.unity3d.com/">issue tracker on unity</a>

  3. andrewjose

    Apr 29, 2021 11:16

    Hey, Thanks!

  4. hollydearthe

    Mar 11, 2021 07:53

    Those manifest files are auto generated at compile time aren't they ? Doesn't seem like adding a line to the manifest files.

  5. Robert-pro

    Apr 19, 2018 08:37

    ALEX-LUSHIKU , method work fine for me. this is my AndroidManifest wchich is working Fix All Problem of UNITY FAILS MERGING ANDROID
    =============================================================================

    <?xml version="1.0" encoding="utf-8"?>
    <!--
    This Google Mobile Ads plugin library manifest will get merged with your
    application's manifest, adding the necessary activity and permissions
    required for displaying ads.
    -->
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.admob.demo"
    >

    <!-- Google Mobile Ads Permissions -->
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_UPDATES" />
    <!-- Uncomment to add billing for in-app purchase ads -->
    <!--<uses-permission android:name="com.android.vending.BILLING"/> -->
    <application android:theme="@style/UnityThemeSelector"
    android:icon="@drawable/app_icon"
    android:label="@string/app_name" >
    <activity
    android:name="com.unity3d.player.UnityPlayerActivity"
    android:label="@string/app_name" >
    <intent-filter>
    <action android:name="android.intent.action.MAIN" />

    <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    </activity>

    </application>



    </manifest>

  6. yjaveri99

    Apr 16, 2018 11:45

    Same problem.Please help!!!

  7. Alex-Lushiku

    Jan 10, 2018 17:58

    Go to your AndroidManifest.xml inside your plugin's folder (I used Unity Admob so it was at Assets/Plugins/Android) and paste `xmlns:tools="http://schemas.android.com/tools"` below `xmlns:android="http://schemas.android.com/apk/res/android`

  8. donzaemon

    Nov 24, 2017 06:45

    Those manifest files are auto generated at compile time aren't they ? Doesn't seem like adding a line to the manifest files will do anything because they are regenerated .. ? Where do we find the source that is generating them ?

  9. iluqmansharif

    Nov 22, 2017 11:01

    I did add xmlns:tools="http://schemas.android.com/tools" in that AndroidManifest file as per you said above but it still didn't solve my issue. I don't see why :/

  10. ToyBrain101

    Oct 21, 2017 03:38

    I can't get around this. it is a nightmare! can anyone help me please?

Add comment

Log in to post comment