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" 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 (6)

  1. 0e6c1d456bb9aedf256bbe28f2e05936?d=mm

    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>

  2. D9de7898f722ce9277095799ab550fdb?d=mm

    yjaveri99

    Apr 16, 2018 11:45

    Same problem.Please help!!!

  3. E06fe361a74ad7bbe80f92dcef31f5e4?d=mm

    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`

  4. 264a7dd3042b40d1f1dc524b13383ea7?d=mm

    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 ?

  5. 1eb64e97c6cf7f7e59f01ee4a7af0503?d=mm

    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 :/

  6. 4530a8b773b014334eea81628400199c?d=mm

    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

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.