2016-04-27 111 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

相关问题