Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Facebook SDK merge error in AndroidManifest.xml

Discussion in 'Android' started by MyNameIsHugo, Jul 28, 2016.

  1. MyNameIsHugo

    MyNameIsHugo

    Joined:
    Jul 28, 2016
    Posts:
    1
    Hey guys! How are you doing ?
    I´m almost finishing my first app. And it´s basically a trivia game. But i need Facebook SDK to do a rank with the users friends. But when i started building it for android i receive this error:


    Error building Player: CommandInvokationFailure: Unable to merge android manifests. See the Console for more details.
    C:/Program Files/Java/jdk1.8.0_91\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Users/Hugo/AppData/Local/Android/sdk2\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -

    stderr[
    Error: [Temp\StagingArea\AndroidManifest-main.xml:22, C:\Users\Hugo\Desktop\backup\Quiz Estudar seu\Temp\StagingArea\android-libraries\facebook-android-sdk-4.12.1\AndroidManifest.xml:6] Trying to merge incompatible /manifest/application/activity[@name=com.facebook.FacebookActivity] element:
    <activity
    -- @android:label="@String/app_name"
    -- @android:name="com.facebook.FacebookActivity"
    -- @android:theme="@android:style/Theme.Translucent.NoTitleBar">
    <activity
    ++ @android:name="com.facebook.FacebookActivity"
    ++ @android:theme="@android:style/Theme.Translucent.NoTitleBar">
    ++</activity>
    ]
    stdout[

    ]


    I´m one week trying to solve this, and i´ve read all posts that talsk about it, but i did not understand how can i solve this. Can someome guive me a hint of what to do ? Thanks!
     
  2. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,555
    The problem is that you have 2 different declarations of the same activity (com.facebook.FacebookActivity).
    These are not identical declarations, and the tool that Unity uses to merge all manifests into 1 single manifest, fails to automatically do this merge for you.

    The output can give you a clue as to what the actual issue is. You can start by looking where you have these 2 declarations for the FacebookActivity. You should only keep 1 declaration of this activity and then this issue would be resolved.
     
  3. YuriBazila

    YuriBazila

    Joined:
    Feb 1, 2013
    Posts:
    47
    If you want to update your facebook sdk, you have to remove FacebookSDK folder from your Assets and import new one from the facebook unitypackage. If you just import new version above the old one you would get that error