Unable to merge Android manifests. (5.6.0p3)
I got passed the 'Unable to list target platforms' error by installing the 5.6.0p3 patch. The build goes further along, and I get stuck at 'Unable to merge Android manifests'.
Console Error
CommandInvokationFailure: Unable to merge android manifests. See the Console for more details.
C:/Program Files/Java/jdk1.8.0_131\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Users/Name/AppData/Local/Android/sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -
stderr[
Error:Invalid command manifmerger
]
stdout[
]
exit code: 64
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()
Answer by liortal · Jun 07, 2017 at 07:16 PM
Just to give a slightly more detailed answer, mirroring my answer from this stack overflow post:
The error happens due to this Unity bug (related to the latest Android SDK tools version).
You can see in the error message that the "manifmerger" tool returns an error code (64):
stderr[ Error:Invalid command manifmerger ] stdout[
] exit code: 64
The bug is fixed in the latest Unity (beta) version. There is a workaround, as described on that page:
Workaround for the customers.
For Windows, get "tools_r25.2.3-windows.zip" download and unzip it or, on mac: find MacOSX "tools_r25.2.3-macosx.zip" download and unzip it.
In the SDK path replace the tools folder.
This is a quote from the issuetracker page. I've added direct links to the downloads, since they seem to be missing from the Android website.
This worked and only takes 2 seconds :) Not only did it take care of the 'Unable to merge android manifests' error message but it has also removed the unwanted READ_PHONE_STATE permission that was automatically added with no reason, apparently another bug in there and I had not been able to get rid of that permission for hours! So that's 2 answers in one :)
You're right there. Has Unity haven't released a fix on that yet? Bug reports should flood their issue trackers until then.
This is the best answer I've got so far since I encountered the issue. Simple and fast. ayt!
Answer by Jes28 · May 10, 2017 at 11:23 AM
I have fixed that by downloading and apply http://dl.google.com/android/android-sdk_r23-windows.zip to my AndroidSDK folder