【问题标题】:Unity Admob and Google Play Game Services Build ErrorUnity Admob 和 Google Play 游戏服务构建错误
【发布时间】:2017-10-18 11:45:14
【问题描述】:

我一直在努力理解如何修复错误:“无法重新打包资源”当我同时安装了 AdMob 统一插件和 Google Play 游戏插件时,我似乎无法构建我的应用程序。我正在使用 Unity Unity 5.6.1f1(64 位)。

游戏服务:https://github.com/playgameservices/play-games-plugin-for-unity 广告:https://github.com/unity-plugins/Firebase-Admob-Unity

在我添加 google play 游戏服务插件之前它工作正常。任何帮助将不胜感激。

我认为错误的相关部分:

CommandInvokationFailure: Failed to re-package resources.
 C:\Users\Jack\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/Jack/AppData/Local/Android/sdk\platforms\android-25\android.jar" -F bin/resources.ap_ --extra-packages android.support.v7.appcompat:com.unity.purchasing:com.android.vending.billing:com.unity.purchasing.googleplay:com.google.example.games.mainlibproj:com.google.android.gms.ads.impl:com.google.android.gms.ads:com.google.android.gms.auth.api:com.google.android.gms.auth:com.google.android.gms.base:com.google.android.gms.base:com.google.android.gms:com.google.android.gms:com.google.android.gms.drive:com.google.android.gms.games:com.google.android.gms.gass:com.google.android.gms.nearby:com.google.android.gms.tasks:com.google.android.gms.tasks:android.support.compat:android.support.coreui:android.support.coreutils:android.support.fragment:android.support.mediacompat:android.support.v4 -S "E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res" -S "E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\common\res" -S "E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\GoogleAIDL\res" -S "E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\GooglePlay\res" -S "E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\play-services-ads-10.2.0\res" -S "E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\play-services-ads-lite-10.2.0\res" -S "E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\play-services-auth-10.2.6\res" -S "E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\play-services-auth-base-10.2.6\res" -S "E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\play-services-base-10.2.0\res" -S "E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\play-services-base-10.2.6\res" -S "E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\play-services-basement-10.2.0\res" -S "E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\play-services-basement-10.2.6\res" -S "E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\play-services-drive-10.2.6\res" -S "E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\play-services-games-10.2.6\res" -S "E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\play-services-gass-10.2.0\res" -S "E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\play-services-nearby-10.2.6\res" -S "E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\play-services-tasks-10.2.0\res" -S "E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\play-services-tasks-10.2.6\res" -S "E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\support-compat-25.2.0\res" -S "E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\support-core-ui-25.2.0\res" -S "E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\support-core-utils-25.2.0\res" -S "E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\support-fragment-25.2.0\res" -S "E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\support-media-compat-25.2.0\res" -S "E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\support-v4-25.2.0\res"

 stderr[
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\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>
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\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.jrfapplications.psychorunner:layout/abc_alert_dialog_button_bar_material for configuration v17.
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\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>
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\abc_alert_dialog_material.xml: note: using v17 attributes; synthesizing resource com.jrfapplications.psychorunner:layout/abc_alert_dialog_material for configuration v17.
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\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>
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\abc_dialog_title_material.xml: note: using v17 attributes; synthesizing resource com.jrfapplications.psychorunner:layout/abc_dialog_title_material for configuration v17.
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\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>
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\abc_screen_toolbar.xml: note: using v21 attributes; synthesizing resource com.jrfapplications.psychorunner:layout/abc_screen_toolbar for configuration v21.
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\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>
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\abc_search_view.xml: note: using v17 attributes; synthesizing resource com.jrfapplications.psychorunner:layout/abc_search_view for configuration v17.
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\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>
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\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>
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\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>
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\notification_template_big_media.xml: note: using v17 attributes; synthesizing resource com.jrfapplications.psychorunner:layout/notification_template_big_media for configuration v17.
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\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>
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\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>
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\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:layoutDirection from <LinearLayout>
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\notification_template_big_media_narrow.xml:38: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <include>
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\notification_template_big_media_narrow.xml:38: note: removing attribute http://schemas.android.com/apk/res/android:layout_toStartOf from <include>
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\notification_template_big_media_narrow.xml:30: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentEnd from <include>
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\notification_template_big_media_narrow.xml: note: using v17 attributes; synthesizing resource com.jrfapplications.psychorunner:layout/notification_template_big_media_narrow for configuration v17.
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\notification_template_lines.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:paddingEnd from <LinearLayout>
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\notification_template_lines.xml:77: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <LinearLayout>
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\notification_template_lines.xml:96: note: removing attribute http://schemas.android.com/apk/res/android:paddingStart from <TextView>
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\notification_template_lines.xml:64: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <TextView>
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\notification_template_lines.xml:27: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <LinearLayout>
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\notification_template_lines.xml: note: using v17 attributes; synthesizing resource com.jrfapplications.psychorunner:layout/notification_template_lines for configuration v17.
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\notification_template_media.xml:43: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginEnd from <include>
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\notification_template_media.xml:33: note: removing attribute http://schemas.android.com/apk/res/android:layoutDirection from <LinearLayout>
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\notification_template_media.xml: note: using v17 attributes; synthesizing resource com.jrfapplications.psychorunner:layout/notification_template_media for configuration v17.
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\notification_template_part_chronometer.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:paddingStart from <Chronometer>
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\notification_template_part_chronometer.xml: note: using v17 attributes; synthesizing resource com.jrfapplications.psychorunner:layout/notification_template_part_chronometer for configuration v17.
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\notification_template_part_time.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:paddingStart from <DateTimeView>
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\notification_template_part_time.xml: note: using v17 attributes; synthesizing resource com.jrfapplications.psychorunner:layout/notification_template_part_time for configuration v17.
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\select_dialog_multichoice_material.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:paddingStart from <CheckedTextView>
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\select_dialog_multichoice_material.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:paddingEnd from <CheckedTextView>
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\select_dialog_multichoice_material.xml: note: using v17 attributes; synthesizing resource com.jrfapplications.psychorunner:layout/select_dialog_multichoice_material for configuration v17.
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\select_dialog_singlechoice_material.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:paddingStart from <CheckedTextView>
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\select_dialog_singlechoice_material.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:paddingEnd from <CheckedTextView>
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\layout\select_dialog_singlechoice_material.xml: note: using v17 attributes; synthesizing resource com.jrfapplications.psychorunner:layout/select_dialog_singlechoice_material for configuration v17.
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\drawable\abc_ratingbar_indicator_material.xml:23: note: removing attribute http://schemas.android.com/apk/res/android:tileModeX from <bitmap>
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\drawable\abc_ratingbar_indicator_material.xml: note: using v21 attributes; synthesizing resource com.jrfapplications.psychorunner:drawable/abc_ratingbar_indicator_material for configuration v21.
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\drawable\abc_ratingbar_small_material.xml:23: note: removing attribute http://schemas.android.com/apk/res/android:tileModeX from <bitmap>
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res\drawable\abc_ratingbar_small_material.xml: note: using v21 attributes; synthesizing resource com.jrfapplications.psychorunner:drawable/abc_ratingbar_small_material for configuration v21.
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\play-services-base-10.2.0\res\values\values.xml:33: error: Attribute "imageAspectRatioAdjust" already defined with incompatible format.
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\play-services-base-10.2.6\res\values\values.xml:34: Original attribute defined here.
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\play-services-base-10.2.0\res\values\values.xml:46: error: Attribute "buttonSize" already defined with incompatible format.
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\play-services-base-10.2.6\res\values\values.xml:47: Original attribute defined here.
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\play-services-base-10.2.0\res\values\values.xml:54: error: Attribute "colorScheme" already defined with incompatible format.
 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\play-services-base-10.2.6\res\values\values.xml:55: Original attribute defined here.
 ]

【问题讨论】:

    标签: c# unity3d admob unity5 google-play-games


    【解决方案1】:

    这通常表示您在 Assets/Plugins/Android(或子目录)中有多个版本的 support-v4-*.aar 文件。

    我建议保留支持库的最佳版本并删除旧版本。

    【讨论】:

    • 我已经安装了两个插件的新副本,并且在我的插件文件夹中我有一份 support-v4 副本 support-v4-25.2.0 感谢您的回复
    • 你指出了我正确的方向,删除重复的 aar 文件后错误已经消失,但我有新的错误。感谢指导
    【解决方案2】:

    E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\play-services-base-10.2.0\res\values\values.xml:33: 错误:属性“imageAspectRatioAdjust”已经定义 格式不兼容。 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\play-services-base-10.2.6\res\values\values.xml:34: 此处定义的原始属性。 E:\JRFApplications\Apps\Psycho 破折号\心理 Dash\Temp\StagingArea\android-libraries\play-services-base-10.2.0\res\values\values.xml:46: 错误:属性“buttonSize”已经定义为不兼容 格式。 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\play-services-base-10.2.6\res\values\values.xml:47: 此处定义的原始属性。 E:\JRFApplications\Apps\Psycho 破折号\心理 Dash\Temp\StagingArea\android-libraries\play-services-base-10.2.0\res\values\values.xml:54: 错误:属性“colorScheme”已经定义为不兼容 格式。 E:\JRFApplications\Apps\Psycho Dash\Psycho Dash\Temp\StagingArea\android-libraries\play-services-base-10.2.6\res\values\values.xml:55: 此处定义的原始属性。

    可以在日志的最后部分看到该问题。您可以看到您拥有两次不同版本的同一个库(play-services-base)——一个是 10.2.0,另一个是 10.2.6。

    这会产生冲突,阻止您构建 APK。

    您应该在构建之前消除这些重复项。

    【讨论】:

      猜你喜欢
      • 2014-10-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多