Reputation: 159
TL;DR
Hi all I am developing App on Unity3D for Android. However when I want to build the Android project. Errors showed Manifest files conflict. I have searched for a while and most of these conflicts are version conflict. Which I think I have solved it by manually changing minSDKVersion & targetSDKVersion in all the Manifest files. However, I cannot solve this (3 errors in total),
(1) Error: [Temp/StagingArea/AndroidManifest-main.xml:36, /Temp/StagingArea/android-libraries/facebook-android-sdk-4.14.0/AndroidManifest.xml:6] Trying to merge incompatible /manifest/application/activity[@name=com.facebook.FacebookActivity] element:
UnityEditor.HostView:OnGUI()
(2) CommandInvokationFailure: Unable to merge android manifests. See the Console for more details. /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/bin/java -Xmx2048M -Dcom.android.sdkmanager.toolsdir="/Users/xxx/Library/Android/sdk/tools" -Dfile.encoding=UTF8 -jar "/Applications/Unity/PlaybackEngines/AndroidPlayer/Tools/sdktools.jar" -
stderr[ Error: [Temp/StagingArea/AndroidManifest-main.xml:36, /Temp/StagingArea/android-libraries/facebook-android-sdk-4.14.0/AndroidManifest.xml:6] Trying to merge incompatible /manifest/application/activity[@name=com.facebook.FacebookActivity] element:
<activity
-- @android:name="com.facebook.FacebookActivity">
--</activity>
--(end reached)
<activity
++ @android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
++ @android:name="com.facebook.FacebookActivity"
++ @android:theme="@android:style/Theme.Translucent.NoTitleBar">
]
stdout[ [Temp/StagingArea/AndroidManifest-main.xml:8, /Temp/StagingArea/android-libraries/NatCam/AndroidManifest.xml:18] 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()
(3) Error building Player: CommandInvokationFailure: Unable to merge android manifests. See the Console for more details. /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/bin/java -Xmx2048M -Dcom.android.sdkmanager.toolsdir="/Users/xxx/Library/Android/sdk/tools" -Dfile.encoding=UTF8 -jar "/Applications/Unity/PlaybackEngines/AndroidPlayer/Tools/sdktools.jar" -
stderr[ Error: [Temp/StagingArea/AndroidManifest-main.xml:36, /Temp/StagingArea/android-libraries/facebook-android-sdk-4.14.0/AndroidManifest.xml:6] Trying to merge incompatible /manifest/application/activity[@name=com.facebook.FacebookActivity] element:
<activity
-- @android:name="com.facebook.FacebookActivity">
--</activity>
--(end reached)
<activity
++ @android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
++ @android:name="com.facebook.FacebookActivity"
++ @android:theme="@android:style/Theme.Translucent.NoTitleBar">
]
stdout[ [Temp/StagingArea/AndroidManifest-main.xml:8, /Temp/StagingArea/android-libraries/NatCam/AndroidManifest.xml:18] Skipping identical /manifest/application/meta-data[@name=com.google.android.gms.version] element. ]
(Sorry if it's bad formatting but "<>" has to be marked as code instead of quote) It seems like the activities problem, which I found this. Since I have never touched with Android project before thus I have no idea what this "activity" is about. Can anyone point out what is the problem here?
Upvotes: 0
Views: 1944
Reputation: 624
The manifests cannot be merged because you have duplicate declarations of the Facebook activity.
Most likely you accidentally have more than one copy of the Facebook AndroidManifest in your project.
You should not need to edit the manifests themselves, they should work out of the box.
Just look through your project and delete any duplicates you find.
Worst case, delete anything Facebook from your project and reimport the plugin.
For a little background info, think of Activities like scenes in unity. In a manifest you have to declare all your activities. When merging, if 2 activities of the same name are found, it doesn't know what to do and throws that error.
Upvotes: 2