2016-04-27 110 views
0

我正在嘗試將Heyzap與幾個廣告客戶SDK集成。 適用於iOS的建築物不會給我帶來任何問題,只會在爲Android構建時發生。 我嘗試刪除UnityAds AndroidManifest.xml文件,但它不會再生成,所以我不得不把它放回去。 2天前我做了新的Android Studio安裝,所以我認爲ADT應該在最後一個版本?構建播放器時出錯:CommandInvokationFailure:在Unity3D中爲Android構建時無法重新打包資源

Error building Player: CommandInvokationFailure: Failed to re-package resources. See the Console for details. 
C:\sdk\android-sdk\build-tools\23.0.3\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/sdk/android-sdk\platforms\android-23\android.jar" -F bin/resources.ap_ --extra-packages com.facebook.ads:com.chartboost.sdk.unity:com.google.android.gms:com.heyzap:com.hyprmx.android.sdk:com.unity3d.ads.android:com.pushok.test -S "C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\ads-release\res" -S "C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\google-play-services_lib\res" -S "C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\HyprMX-SDK\res" -S "C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res" 

stderr[ 
C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\HyprMX-SDK\res\drawable-mdpi\close.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited 
C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\google-play-services_lib\res\layout\place_autocomplete_item_powered_by_google.xml:28: note: removing attribute http://schemas.android.com/apk/res/android:layout_toEndOf from <ImageView> 
C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\google-play-services_lib\res\layout\place_autocomplete_item_powered_by_google.xml:28: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <ImageView> 
C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\google-play-services_lib\res\layout\place_autocomplete_item_powered_by_google.xml:8: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <View> 
C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\google-play-services_lib\res\layout\place_autocomplete_item_powered_by_google.xml: note: using v17 attributes; synthesizing resource com.Brixbyte.AwesomeArcadeTemplate:layout/place_autocomplete_item_powered_by_google for configuration v17. 
C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\google-play-services_lib\res\layout\place_autocomplete_item_prediction.xml:52: note: removing attribute http://schemas.android.com/apk/res/android:layout_toEndOf from <TextView> 
C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\google-play-services_lib\res\layout\place_autocomplete_item_prediction.xml:35: note: removing attribute http://schemas.android.com/apk/res/android:layout_toEndOf from <TextView> 
C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\google-play-services_lib\res\layout\place_autocomplete_item_prediction.xml:8: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentStart from <include> 
C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\google-play-services_lib\res\layout\place_autocomplete_item_prediction.xml: note: using v17 attributes; synthesizing resource com.Brixbyte.AwesomeArcadeTemplate:layout/place_autocomplete_item_prediction for configuration v17. 
C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\google-play-services_lib\res\layout\place_autocomplete_progress.xml:2: note: removing attribute http://schemas.android.com/apk/res/android:indeterminateTint from <ProgressBar> 
C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\google-play-services_lib\res\layout\place_autocomplete_progress.xml:2: note: removing attribute http://schemas.android.com/apk/res/android:indeterminateTintMode from <ProgressBar> 
C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\google-play-services_lib\res\layout\place_autocomplete_progress.xml: note: using v21 attributes; synthesizing resource com.Brixbyte.AwesomeArcadeTemplate:layout/place_autocomplete_progress for configuration v21. 
C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\layout\unityads_button_audio_toggle.xml:2: note: removing attribute http://schemas.android.com/apk/res/android:paddingStart from <RelativeLayout> 
C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\layout\unityads_button_audio_toggle.xml:61: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <TextView> 
C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\layout\unityads_button_audio_toggle.xml:27: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentStart from <RelativeLayout> 
C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\layout\unityads_button_audio_toggle.xml:27: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <RelativeLayout> 
C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\layout\unityads_button_audio_toggle.xml:52: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <View> 
C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\layout\unityads_button_audio_toggle.xml:44: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <View> 
C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\layout\unityads_button_audio_toggle.xml:19: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentStart from <View> 
C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\layout\unityads_button_audio_toggle.xml:10: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <View> 
C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\layout\unityads_button_audio_toggle.xml: note: using v17 attributes; synthesizing resource com.Brixbyte.AwesomeArcadeTemplate:layout/unityads_button_audio_toggle for configuration v17. 
C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\layout\unityads_button_pause.xml:8: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <View> 
C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\layout\unityads_button_pause.xml: note: using v17 attributes; synthesizing resource com.Brixbyte.AwesomeArcadeTemplate:layout/unityads_button_pause for configuration v17. 
C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\layout\unityads_view_video_play.xml:92: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentStart from <include> 
C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\layout\unityads_view_video_play.xml:57: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentEnd from <LinearLayout> 
C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\layout\unityads_view_video_play.xml:57: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginEnd from <LinearLayout> 
C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\layout\unityads_view_video_play.xml:44: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginEnd from <TextView> 
C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\layout\unityads_view_video_play.xml:29: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <TextView> 
C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\layout\unityads_view_video_play.xml: note: using v17 attributes; synthesizing resource com.Brixbyte.AwesomeArcadeTemplate:layout/unityads_view_video_play for configuration v17. 
C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\google-play-services_lib\res\values\base_attrs.xml:11: error: Attribute "buttonSize" has already been defined 

] 
stdout[ 
Configurations: 
(default) 

Files: 
    drawable\unityads_background_button_pause.xml 
    Src:() C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\drawable\unityads_background_button_pause.xml 
    drawable\unityads_icon_play.xml 
    Src:() C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\drawable\unityads_icon_play.xml 
    drawable\unityads_icon_speaker_base.xml 
    Src:() C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\drawable\unityads_icon_speaker_base.xml 
    drawable\unityads_icon_speaker_triangle.xml 
    Src:() C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\drawable\unityads_icon_speaker_triangle.xml 
    drawable\unityads_icon_speaker_waves.xml 
    Src:() C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\drawable\unityads_icon_speaker_waves.xml 
    layout\unityads_button_audio_toggle.xml 
    Src:() C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\layout\unityads_button_audio_toggle.xml 
    layout\unityads_button_pause.xml 
    Src:() C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\layout\unityads_button_pause.xml 
    layout\unityads_view_video_paused.xml 
    Src:() C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\layout\unityads_view_video_paused.xml 
    layout\unityads_view_video_play.xml 
    Src:() C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\layout\unityads_view_video_play.xml 
    values\strings.xml 
    Src:() C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\values\strings.xml 
    AndroidManifest.xml 
    Src:() AndroidManifest.xml 

Resource Dirs: 
    Type drawable 
    drawable\unityads_background_button_pause.xml 
     Src:() C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\drawable\unityads_background_button_pause.xml 
    drawable\unityads_icon_play.xml 
     Src:() C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\drawable\unityads_icon_play.xml 
    drawable\unityads_icon_speaker_base.xml 
     Src:() C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\drawable\unityads_icon_speaker_base.xml 
    drawable\unityads_icon_speaker_triangle.xml 
     Src:() C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\drawable\unityads_icon_speaker_triangle.xml 
    drawable\unityads_icon_speaker_waves.xml 
     Src:() C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\drawable\unityads_icon_speaker_waves.xml 
    Type layout 
    layout\unityads_button_audio_toggle.xml 
     Src:() C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\layout\unityads_button_audio_toggle.xml 
    layout\unityads_button_pause.xml 
     Src:() C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\layout\unityads_button_pause.xml 
    layout\unityads_view_video_paused.xml 
     Src:() C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\layout\unityads_view_video_paused.xml 
    layout\unityads_view_video_play.xml 
     Src:() C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\layout\unityads_view_video_play.xml 
    Type values 
    values\strings.xml 
     Src:() C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\unityads\res\values\strings.xml 
Including resources from package: C:\sdk\android-sdk\platforms\android-23\android.jar 
applyFileOverlay for drawable 
trying overlaySet Key=close.png 
trying overlaySet Key=graybutton.9.png 
trying overlaySet Key=greenbutton.9.png 
trying overlaySet Key=hypr_progress_drawable.xml 
trying overlaySet Key=next_button.xml 
trying overlaySet Key=cast_ic_notification_0.png 
trying overlaySet Key=cast_ic_notification_1.png 
trying overlaySet Key=cast_ic_notification_2.png 
trying overlaySet Key=cast_ic_notification_connecting.xml 
trying overlaySet Key=cast_ic_notification_on.png 
trying overlaySet Key=common_full_open_on_phone.png 
trying overlaySet Key=common_google_signin_btn_icon_dark.xml 
trying overlaySet Key=common_google_signin_btn_icon_dark_disabled.9.png 
trying overlaySet Key=common_google_signin_btn_icon_dark_focused.9.png 
trying overlaySet Key=common_google_signin_btn_icon_dark_normal.9.png 
trying overlaySet Key=common_google_signin_btn_icon_dark_pressed.9.png 
trying overlaySet Key=common_google_signin_btn_icon_light.xml 
trying overlaySet Key=common_google_signin_btn_icon_light_disabled.9.png 
trying overlaySet Key=common_google_signin_btn_icon_light_focused.9.png 
trying overlaySet Key=common_google_signin_btn_icon_light_normal.9.png 
trying overlaySet Key=common_google_signin_btn_icon_light_pressed.9.png 
trying overlaySet Key=common_google_signin_btn_text_dark.xml 
trying overlaySet Key=common_google_signin_btn_text_dark_disabled.9.png 
trying overlaySet Key=common_google_signin_btn_text_dark_focused.9.png 
trying overlaySet Key=common_google_signin_btn_text_dark_normal.9.png 
trying overlaySet Key=common_google_signin_btn_text_dark_pressed.9.png 
trying overlaySet Key=common_google_signin_btn_text_light.xml 
trying overlaySet Key=common_google_signin_btn_text_light_disabled.9.png 
trying overlaySet Key=common_google_signin_btn_text_light_focused.9.png 
trying overlaySet Key=common_google_signin_btn_text_light_normal.9.png 
trying overlaySet Key=common_google_signin_btn_text_light_pressed.9.png 
trying overlaySet Key=common_ic_googleplayservices.png 
trying overlaySet Key=common_plus_signin_btn_icon_dark.xml 
trying overlaySet Key=common_plus_signin_btn_icon_dark_disabled.9.png 
trying overlaySet Key=common_plus_signin_btn_icon_dark_focused.9.png 
trying overlaySet Key=common_plus_signin_btn_icon_dark_normal.9.png 
trying overlaySet Key=common_plus_signin_btn_icon_dark_pressed.9.png 
trying overlaySet Key=common_plus_signin_btn_icon_light.xml 
trying overlaySet Key=common_plus_signin_btn_icon_light_disabled.9.png 
trying overlaySet Key=common_plus_signin_btn_icon_light_focused.9.png 
trying overlaySet Key=common_plus_signin_btn_icon_light_normal.9.png 
trying overlaySet Key=common_plus_signin_btn_icon_light_pressed.9.png 
trying overlaySet Key=common_plus_signin_btn_text_dark.xml 
trying overlaySet Key=common_plus_signin_btn_text_dark_disabled.9.png 
trying overlaySet Key=common_plus_signin_btn_text_dark_focused.9.png 
trying overlaySet Key=common_plus_signin_btn_text_dark_normal.9.png 
trying overlaySet Key=common_plus_signin_btn_text_dark_pressed.9.png 
trying overlaySet Key=common_plus_signin_btn_text_light.xml 
trying overlaySet Key=common_plus_signin_btn_text_light_disabled.9.png 
trying overlaySet Ke<message truncated> 

回答

1

它看起來像有與谷歌播放服務清單合併衝突。

嘗試刪除C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\google-play-services_lib文件夾。使用https://github.com/googleads/googleads-mobile-unity插件來代替安裝所需的Google Play服務。如果您使用的是谷歌播放服務遊戲API,請嘗試使用此插件:https://github.com/playgameservices/play-games-plugin-for-unity

這些插件處理谷歌播放服務依賴關係的方式與默認情況下的Heyzap有所不同。我是Heyzap的工程師,我們正在考慮改變我們處理Unity的Google Play服務依賴關係的方式。我希望這可以幫助你,請讓我知道這是否能解決你的問題。

+0

我像你說的那樣刪除了Assets/Plugins/Android/google-play-services_lib並安裝了googleads-mobile-unity。之前的錯誤消息已經消失,但我得到了一個關於AndroidManifest合併問題的新消息。它似乎與它有關:https://github.com/playgameservices/play-games-plugin-for-unity/issues/801#issuecomment-179314012。我想googleads-mobile-unity與安裝嚮導提出的admob版本不兼容。我將使用googleads-mobile-unity重新從頭開始重新導入。 – 3pns

+0

想想這次我和admob一起工作。我做了回滾,單獨使用Heyzap,然後導入了googlemobileads包,它似乎可以正常工作和編譯。今天它不再工作了,生成了一些文件。然後,我再次做了你所說的,刪除了google-play-services_lib文件夾。並且它再次編譯...但是這次admob廣告被顯示。現在如果我嘗試重新導入他們的包,那麼項目中缺少2個文件:PlayServiceResolver/Editor/AdMobDependencies.cs和PlayServiceResolver/JarResolverLib.ddl。所以它與這個文件夾和那兩個文件是完全相關的 – 3pns

相關問題