Unity3D - CommandInvokationFailure:重新打包资源失败

Posted

技术标签:

【中文标题】Unity3D - CommandInvokationFailure:重新打包资源失败【英文标题】:Unity3D - CommandInvokationFailure: Failed to re-package resources 【发布时间】:2018-03-21 15:30:48 【问题描述】:

我在构建 apk 时遇到 CommandInvokationFailure 错误。我目前正在使用他们官方网站上的 Google Play Games 插件和 Facebook SDK,以及 Unity IAP、Analytics 等一些 Unity 服务。我尝试了我能做的,但我无法解决这个问题。提前致谢。

CommandInvokationFailure: Failed to re-package resources. D:\androidSDK\build-tools\26.0.2\aapt.exe package --auto-add-overlay -v -f -m -J "gen" -M "AndroidManifest.xml" -S "res" -I "D:/AndroidSDK\platforms\android-26\android.jar" -F bin/resources.ap_ --extra-packages android.support.graphics.drawable.animated:android.support.graphics.drawable.animated:android.support.v7.appcompat:android.support.v7.appcompat:android.support.v7.cardview:android.support.v7.cardview:android.support.customtabs:android.support.customtabs:com.facebook:com.facebook.android:com.google.example.games.mainlibproj:com.google.android.gms.auth.api:com.google.android.gms.auth:com.google.android.gms.base:com.google.android.gms:com.google.android.gms.drive:com.google.android.gms.games:com.google.android.gms.nearby:com.google.android.gms.tasks:android.support.compat:android.support.compat:android.support.coreui:android.support.coreui:android.support.coreutils:android.support.coreutils:android.support.fragment:android.support.fragment:android.support.mediacompat:android.support.mediacompat:android.support.v4:android.support.v4:android.support.v4:android.support.graphics.drawable:android.support.graphics.drawable:com.unity3d.ads:com.unity.channel.sdk.editor.xiaomi -S "D:\MyProject\Temp\StagingArea\android-libraries\animated-vector-drawable-23.4.0\res" -S "D:\MyProject\Temp\StagingArea\android-libraries\animated-vector-drawable-25.3.1\res" -S "D:\MyProject\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res" -S "D:\MyProject\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res" -S "D:\MyProject\Temp\StagingArea\android-libraries\cardview-v7-23.4.0\res" -S "D:\MyProject\Temp\StagingArea\android-libraries\cardview-v7-25.3.1\res" -S "D:\MyProject\Temp\StagingArea\android-libraries\customtabs-23.4.0\res" -S "D:\MyProject\Temp\StagingArea\android-libraries\customtabs-25.3.1\res" -S "D:\MyProject\Temp\StagingArea\android-libraries\facebook-android-sdk-4.17.0\res" -S "D:\MyProject\Temp\StagingArea\android-libraries\facebook-android-wrapper-7.9.0\res" -S "D:\MyProject\Temp\StagingArea\android-libraries\play-services-auth-10.2.6\res" -S "D:\MyProject\Temp\StagingArea\android-libraries\play-services-auth-base-10.2.6\res" -S "D:\MyProject\Temp\StagingArea\android-libraries\play-services-base-10.2.6\res" -S "D:\MyProject\Temp\StagingArea\android-libraries\play-services-basement-10.2.6\res" -S "D:\MyProject\Temp\StagingArea\android-libraries\play-services-drive-10.2.6\res" -S "D:\MyProject\Temp\StagingArea\android-libraries\play-services-games-10.2.6\res" -S "D:\MyProject\Temp\StagingArea\android-libraries\play-services-nearby-10.2.6\res" -S "D:\MyProject\Temp\StagingArea\android-libraries\play-services-tasks-10.2.6\res" -S "D:\MyProject\Temp\StagingArea\android-libraries\support-compat-25.2.0\res" -S "D:\MyProject\Temp\StagingArea\android-libraries\support-compat-25.3.1\res" -S "D:\MyProject\Temp\StagingArea\android-libraries\support-core-ui-25.2.0\res" -S "D:\MyProject\Temp\StagingArea\android-libraries\support-core-ui-25.3.1\res" -S "D:\MyProject\Temp\StagingArea\android-libraries\support-core-utils-25.2.0\res" -S "D:\MyProject\Temp\StagingArea\android-libraries\support-core-utils-25.3.1\res" -S "D:\MyProject\Temp\StagingArea\android-libraries\support-fragment-25.2.0\res" -S "D:\MyProject\Temp\StagingArea\android-libraries\support-fragment-25.3.1\res" -S "D:\MyProject\Temp\StagingArea\android-libraries\support-media-compat-25.2.0\res" -S "D:\MyProject\Temp\StagingArea\android-libraries\support-media-compat-25.3.1\res" -S "D:\MyProject\Temp\StagingArea\android-libraries\support-v4-23.4.0\res" -S "D:\MyProject\Temp\StagingArea\android-libraries\support-v4-25.2.0\res" -S "D:\MyProject\Temp\StagingArea\android-libraries\support-v4-25.3.1\res" -S "D:\MyProject\Temp\StagingArea\android-libraries\support-vector-drawable-23.4.0\res" -S "D:\MyProject\Temp\StagingArea\android-libraries\support-vector-drawable-25.3.1\res" -S "D:\MyProject\Temp\StagingArea\android-libraries\UnityAds\res" -S "D:\MyProject\Temp\StagingArea\android-libraries\UnityChannel\res"

    stderr[
    D:\MyProject\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\abc_alert_dialog_button_bar_material.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:layoutDirection from <android.support.v7.widget.ButtonBarLayout>
    D:\MyProject\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\abc_alert_dialog_button_bar_material.xml: note: using v17 attributes; synthesizing resource com.granada.bilgiyaris:layout/abc_alert_dialog_button_bar_material for configuration v17.
    D:\MyProject\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\abc_alert_dialog_material.xml:48: note: removing attribute http://schemas.android.com/apk/res/android:textAlignment from <android.support.v7.widget.DialogTitle>
    D:\MyProject\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\abc_alert_dialog_material.xml: note: using v17 attributes; synthesizing resource com.granada.bilgiyaris:layout/abc_alert_dialog_material for configuration v17.
    D:\MyProject\Temp\StagingArea\android-libraries\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:\MyProject\Temp\StagingArea\android-libraries\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:\MyProject\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\layout\abc_alert_dialog_title_material.xml: note: using v17 attributes; synthesizing resource com.granada.bilgiyaris:layout/abc_alert_dialog_title_material for configuration v17.
    D:\MyProject\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\abc_dialog_title_material.xml:29: note: removing attribute http://schemas.android.com/apk/res/android:textAlignment from <TextView>
    D:\MyProject\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\abc_dialog_title_material.xml: note: using v17 attributes; synthesizing resource com.granada.bilgiyaris:layout/abc_dialog_title_material for configuration v17.
    D:\MyProject\Temp\StagingArea\android-libraries\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:\MyProject\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\layout\abc_popup_menu_header_item_layout.xml: note: using v17 attributes; synthesizing resource com.granada.bilgiyaris:layout/abc_popup_menu_header_item_layout for configuration v17.
    D:\MyProject\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\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:\MyProject\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\abc_screen_toolbar.xml: note: using v21 attributes; synthesizing resource com.granada.bilgiyaris:layout/abc_screen_toolbar for configuration v21.
    D:\MyProject\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\abc_search_view.xml:47: note: removing attribute http://schemas.android.com/apk/res/android:layoutDirection from <LinearLayout>
    D:\MyProject\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\abc_search_view.xml: note: using v17 attributes; synthesizing resource com.granada.bilgiyaris:layout/abc_search_view for configuration v17.
    D:\MyProject\Temp\StagingArea\android-libraries\facebook-android-sdk-4.17.0\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:\MyProject\Temp\StagingArea\android-libraries\facebook-android-sdk-4.17.0\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:\MyProject\Temp\StagingArea\android-libraries\facebook-android-sdk-4.17.0\res\layout\com_facebook_device_auth_dialog_fragment.xml: note: using v17 attributes; synthesizing resource com.granada.bilgiyaris:layout/com_facebook_device_auth_dialog_fragment for configuration v17.
    D:\MyProject\Temp\StagingArea\android-libraries\facebook-android-sdk-4.17.0\res\layout\com_facebook_smart_device_dialog_fragment.xml:112: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <TextView>
    D:\MyProject\Temp\StagingArea\android-libraries\facebook-android-sdk-4.17.0\res\layout\com_facebook_smart_device_dialog_fragment.xml:112: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginEnd from <TextView>
    D:\MyProject\Temp\StagingArea\android-libraries\facebook-android-sdk-4.17.0\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:\MyProject\Temp\StagingArea\android-libraries\facebook-android-sdk-4.17.0\res\layout\com_facebook_smart_device_dialog_fragment.xml: note: using v17 attributes; synthesizing resource com.granada.bilgiyaris:layout/com_facebook_smart_device_dialog_fragment for configuration v17.
    D:\MyProject\Temp\StagingArea\android-libraries\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:\MyProject\Temp\StagingArea\android-libraries\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:\MyProject\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\layout\notification_action.xml: note: using v17 attributes; synthesizing resource com.granada.bilgiyaris:layout/notification_action for configuration v17.
    D:\MyProject\Temp\StagingArea\android-libraries\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:\MyProject\Temp\StagingArea\android-libraries\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:\MyProject\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\layout\notification_action_tombstone.xml: note: using v17 attributes; synthesizing resource com.granada.bilgiyaris:layout/notification_action_tombstone for configuration v17.
    D:\MyProject\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\notification_template_big_media.xml:42: note: removing attribute http://schemas.android.com/apk/res/android:layoutDirection from <LinearLayout>
    D:\MyProject\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\notification_template_big_media.xml:34: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <include>
    D:\MyProject\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\notification_template_big_media.xml:34: note: removing attribute http://schemas.android.com/apk/res/android:layout_toStartOf from <include>
    D:\MyProject\Temp\StagingArea\android-libraries\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:\MyProject\Temp\StagingArea\android-libraries\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:\MyProject\Temp\StagingArea\android-libraries\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:\MyProject\Temp\StagingArea\android-libraries\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:\MyProject\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\layout-v11\notification_template_big_media.xml: note: using v17 attributes; synthesizing resource com.granada.bilgiyaris:layout/notification_template_big_media for configuration v17.
    D:\MyProject\Temp\StagingArea\android-libraries\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:\MyProject\Temp\StagingArea\android-libraries\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:\MyProject\Temp\StagingArea\android-libraries\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:\MyProject\Temp\StagingArea\android-libraries\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:\MyProject\Temp\StagingArea\android-libraries\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:\MyProject\Temp\StagingArea\android-libraries\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_marginEnd from <FrameLayout>
    D:\MyProject\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\layout-v11\notification_template_big_media_custom.xml:27: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentEnd from <include>
    D:\MyProject\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\layout-v11\notification_template_big_media_custom.xml: note: using v17 attributes; synthesizing resource com.granada.bilgiyaris:layout/notification_template_big_media_custom for configuration v17.
    D:\MyProject\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\notification_template_big_media_narrow.xml:60: note: removing attribute http://schemas.android.com/apk/res/android:layout_toEndOf from <ImageView>
    D:\MyProject\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\notification_template_big_media_narrow.xml:46: note: removing attribute http://schemas.android.com/apk/res/android:layout_toEndOf from <LinearLayout>
    D:\MyProject\Temp\StagingArea\android-libraries\appcompat<message truncated>

【问题讨论】:

【参考方案1】:

我通过删除不同版本的支持库、升级 android sdk 和其他所有内容、最后降级工具 t r25.2.5 来解决问题。筋疲力尽

【讨论】:

以上是关于Unity3D - CommandInvokationFailure:重新打包资源失败的主要内容,如果未能解决你的问题,请参考以下文章

求推荐一本unity3d的书.

在unity3d里无法移动物体

[Unity3D]Unity3D游戏开发之从Unity3D到Eclipse

unity3d用键盘控制物体移动的工具

unity3d中如何用脚本创建对象或者类

Unity3D(12)—数组基本语法