Search Unity

Failed to re-package resources with Facebook SDK integrated

Discussion in 'Editor & General Support' started by Ahadid, Jun 1, 2018.

  1. Ahadid

    Ahadid

    Joined:
    Oct 17, 2016
    Posts:
    3
    Hi,

    I have had this error for the past few days when I added Facebook SDK(https://developers.facebook.com/docs/unity/) into my Unity project. I've tried many of the solutions i can find online but none of them seem to solve my issue.
    I have installed the latest android SDK version.
    Currently Unity version 2017.4.1f1

    All help is greatly appreciated.

    Error is thrown out when trying to build as Android Project
    It throws out these 2 errors:

    UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors
    at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x0020e] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:181
    at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00065] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:88
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)


    CommandInvokationFailure: Failed to re-package resources.
    C:\Users\Abdo\AppData\Local\Android\sdk\build-tools\25.0.3\aapt.exe package --auto-add-overlay -v -f -m -J "gen" -M "AndroidManifest.xml" -S "res" -I "C:\Users\Abdo\AppData\Local\Android\sdk\platforms\android-25\android.jar" -F bin/resources.ap_ --extra-packages android.support.graphics.drawable.animated:android.support.v7.appcompat:android.support.v7.cardview:android.support.customtabs:android.support.compat:android.support.coreui:android.support.coreutils:android.support.fragment:android.support.mediacompat:android.support.v4:android.support.graphics.drawable:com.facebook.android:com.facebook.applinks:com.facebook.common:com.facebook.core:com.facebook.login:com.facebook.messenger:com.facebook.places:com.facebook.share:com.unity3d.ads -S "D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.animated-vector-drawable-25.3.1\res" -S "D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res" -S "D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.cardview-v7-25.3.1\res" -S "D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.customtabs-25.3.1\res" -S "D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.support-compat-25.3.1\res" -S "D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.support-core-ui-25.3.1\res" -S "D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.support-core-utils-25.3.1\res" -S "D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.support-fragment-25.3.1\res" -S "D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.support-media-compat-25.3.1\res" -S "D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.support-v4-25.3.1\res" -S "D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.support-vector-drawable-25.3.1\res" -S "D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\facebook-android-wrapper-7.12.0\res" -S "D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\facebook-common\res" -S "D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\facebook-login\res" -S "D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\facebook-messenger\res" -S "D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\facebook-share\res" -S "D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\unity-ads\res"
    stderr[
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout\abc_action_mode_close_item_material.xml:17: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginEnd from <ImageView>
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout\abc_action_mode_close_item_material.xml:17: note: removing attribute http://schemas.android.com/apk/res/android:paddingStart from <ImageView>
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout\abc_action_mode_close_item_material.xml: note: using v17 attributes; synthesizing resource com.thirdcupstudios.desktopdefense:layout/abc_action_mode_close_item_material for configuration v17.
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout\abc_alert_dialog_button_bar_material.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:scrollIndicators from <ScrollView>
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout\abc_alert_dialog_button_bar_material.xml:26: note: removing attribute http://schemas.android.com/apk/res/android:layoutDirection from <android.support.v7.widget.ButtonBarLayout>
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout\abc_alert_dialog_button_bar_material.xml: note: using v17 attributes; synthesizing resource com.thirdcupstudios.desktopdefense:layout/abc_alert_dialog_button_bar_material for configuration v17.
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout\abc_alert_dialog_title_material.xml:45: note: removing attribute http://schemas.android.com/apk/res/android:textAlignment from <android.support.v7.widget.DialogTitle>
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout\abc_alert_dialog_title_material.xml:36: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginEnd from <ImageView>
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout\abc_alert_dialog_title_material.xml: note: using v17 attributes; synthesizing resource com.thirdcupstudios.desktopdefense:layout/abc_alert_dialog_title_material for configuration v17.
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout\abc_dialog_title_material.xml:29: note: removing attribute http://schemas.android.com/apk/res/android:textAlignment from <TextView>
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout\abc_dialog_title_material.xml: note: using v17 attributes; synthesizing resource com.thirdcupstudios.desktopdefense:layout/abc_dialog_title_material for configuration v17.
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout\abc_popup_menu_header_item_layout.xml:24: note: removing attribute http://schemas.android.com/apk/res/android:textAlignment from <TextView>
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout\abc_popup_menu_header_item_layout.xml: note: using v17 attributes; synthesizing resource com.thirdcupstudios.desktopdefense:layout/abc_popup_menu_header_item_layout for configuration v17.
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout\abc_popup_menu_item_layout.xml:59: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <ImageView>
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout\abc_popup_menu_item_layout.xml: note: using v17 attributes; synthesizing resource com.thirdcupstudios.desktopdefense:layout/abc_popup_menu_item_layout for configuration v17.
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout\abc_screen_toolbar.xml:27: note: removing attribute http://schemas.android.com/apk/res/android:touchscreenBlocksFocus from <android.support.v7.widget.ActionBarContainer>
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout\abc_screen_toolbar.xml: note: using v21 attributes; synthesizing resource com.thirdcupstudios.desktopdefense:layout/abc_screen_toolbar for configuration v21.
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout\abc_search_view.xml:47: note: removing attribute http://schemas.android.com/apk/res/android:layoutDirection from <LinearLayout>
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout\abc_search_view.xml: note: using v17 attributes; synthesizing resource com.thirdcupstudios.desktopdefense:layout/abc_search_view for configuration v17.
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout\abc_select_dialog_material.xml:23: note: removing attribute http://schemas.android.com/apk/res/android:textAlignment from <view>
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout\abc_select_dialog_material.xml: note: using v17 attributes; synthesizing resource com.thirdcupstudios.desktopdefense:layout/abc_select_dialog_material for configuration v17.
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\facebook-common\res\layout\com_facebook_device_auth_dialog_fragment.xml:80: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginEnd from <TextView>
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\facebook-common\res\layout\com_facebook_device_auth_dialog_fragment.xml:80: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <TextView>
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\facebook-common\res\layout\com_facebook_device_auth_dialog_fragment.xml: note: using v17 attributes; synthesizing resource com.thirdcupstudios.desktopdefense:layout/com_facebook_device_auth_dialog_fragment for configuration v17.
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\facebook-common\res\layout\com_facebook_smart_device_dialog_fragment.xml:94: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <TextView>
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\facebook-common\res\layout\com_facebook_smart_device_dialog_fragment.xml:94: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginEnd from <TextView>
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\facebook-common\res\layout\com_facebook_smart_device_dialog_fragment.xml:83: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <TextView>
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\facebook-common\res\layout\com_facebook_smart_device_dialog_fragment.xml:83: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginEnd from <TextView>
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\facebook-common\res\layout\com_facebook_smart_device_dialog_fragment.xml:47: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <android.support.v7.widget.AppCompatImageView>
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\facebook-common\res\layout\com_facebook_smart_device_dialog_fragment.xml: note: using v17 attributes; synthesizing resource com.thirdcupstudios.desktopdefense:layout/com_facebook_smart_device_dialog_fragment for configuration v17.
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout\notification_action.xml:17: note: removing attribute http://schemas.android.com/apk/res/android:paddingStart from <LinearLayout>
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout\notification_action.xml:32: note: removing attribute http://schemas.android.com/apk/res/android:paddingStart from <TextView>
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout\notification_action.xml: note: using v17 attributes; synthesizing resource com.thirdcupstudios.desktopdefense:layout/notification_action for configuration v17.
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout\notification_action_tombstone.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:paddingStart from <LinearLayout>
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout\notification_action_tombstone.xml:37: note: removing attribute http://schemas.android.com/apk/res/android:paddingStart from <TextView>
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout\notification_action_tombstone.xml: note: using v17 attributes; synthesizing resource com.thirdcupstudios.desktopdefense:layout/notification_action_tombstone for configuration v17.
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout-v11\notification_template_big_media.xml:42: note: removing attribute http://schemas.android.com/apk/res/android:layoutDirection from <LinearLayout>
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout-v11\notification_template_big_media.xml:34: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <include>
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout-v11\notification_template_big_media.xml:34: note: removing attribute http://schemas.android.com/apk/res/android:layout_toStartOf from <include>
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout-v11\notification_template_big_media.xml:27: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentEnd from <include>
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout-v11\notification_template_big_media.xml: note: using v17 attributes; synthesizing resource com.thirdcupstudios.desktopdefense:layout/notification_template_big_media for configuration v17.
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout-v11\notification_template_big_media_custom.xml:89: note: removing attribute http://schemas.android.com/apk/res/android:layoutDirection from <LinearLayout>
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout-v11\notification_template_big_media_custom.xml:34: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <LinearLayout>
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout-v11\notification_template_big_media_custom.xml:34: note: removing attribute http://schemas.android.com/apk/res/android:layout_toStartOf from <LinearLayout>
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout-v11\notification_template_big_media_custom.xml:56: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginEnd from <FrameLayout>
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout-v11\notification_template_big_media_custom.xml:45: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <FrameLayout>
    D:\Users\Abdo\Documents\GitHub\Desktop-Defense\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout-v11\notification_template_big_media_cus<message truncated>
     
  2. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    The error is truncated, so it's not possible to see the root cause for your problem.

    Here are a few examples of what the usual causes are:
    1. Missing Android libraries (or your libraries are not the required version).
    2. Android library conflicts / duplications.
    3. Too many android libraries in the project (e.g: exceeding the 65k dex method reference limit).
    In order to better understand your issue, please attach the full editor log file (see this link to find where it's stored).

    NOTE:
    I provide a (paid) service for fixing such issues. In case it is urgent for you, or you could not solve the issue, feel free to contact me (link in my signature below).
     
  3. Ahadid

    Ahadid

    Joined:
    Oct 17, 2016
    Posts:
    3
    Hi liortal,

    I've attached the editor logs(I believe).
    How do I go about finding out which is the root cause of this problem?

    Thanks!
     

    Attached Files:

  4. Ahadid

    Ahadid

    Joined:
    Oct 17, 2016
    Posts:
    3
    I could really use the help as this is hindering my work a lot. I've tried so many solutions.. I appreciate any help.
     
  5. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    You are probably including the Facebook SDK, which requires to build using Gradle (from 7.10 or above if i recall correctly).
     
  6. AbedShaib

    AbedShaib

    Joined:
    Aug 27, 2018
    Posts:
    6