Search code examples
androidunity-game-enginebuildheyzap

Error building Player: CommandInvokationFailure: Failed to re-package resource when building for Android in Unity3D


I am trying to integrate Heyzap with several advertiser SDK. Building for iOS give me no problem, it only happens when building for Android. I tried removing UnityAds AndroidManifest.xml file but it won't build again so I had to put it back. I did a fresh new Android Studio install 2 days ago so I think ADT should be at the last version ?

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>

Solution

  • It looks like there is a manifest merger conflict with google play services.

    Try removing the C:\Users\Akatsuki\Documents\Unity3D\awesome-arcade-template\Temp\StagingArea\android-libraries\google-play-services_lib folder. Use the https://github.com/googleads/googleads-mobile-unity plugin to install the needed google play services instead. If you are using google play services Games API try using this plugin too: https://github.com/playgameservices/play-games-plugin-for-unity

    These plugins handle the google play services dependencies a little differently than Heyzap does by default. I am an engineer at Heyzap and we are looking at changing the way we handle google play services dependencies for Unity. I hope that this helps you, please let me know if this solves your problem.