Has anyone been able to solve the Android Manifests bug?

There seems to be a bug in Unity which gives an error for the Android Manifests. If you’re not familiar with the error, i’ll post it below. Has anyone been able to find a fix for this yet?

CommandInvokationFailure: Failed to re-package resources. See the Console for details.
C:\Users\b\AppData\Local\Android\sdk\build-tools\24.0.0-preview\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S “res” -I “C:/Users/b/AppData/Local/Android/sdk\platforms\android-23\android.jar” -F bin/resources.ap_ --extra-packages com.unity.purchasing.amazon:android.support.v7.appcompat:android.support.v7.cardview:com.unity.purchasing:com.facebook:com.facebook.android:com.google.firebase:com.android.vending.billing:com.unity.purchasing.googleplay:com.onesignal:com.google.android.gms.ads.impl:com.google.android.gms.ads:com.google.android.gms.base:com.google.android.gms:com.google.android.gms.tasks:android.support.v4:android.support.v4:com.unity3d.ads.android -S “C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\AmazonAppStore\res” -S “C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res” -S “C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\cardview-v7-23.2.1\res” -S “C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\common\res” -S “C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\facebook-android-sdk-4.11.0\res” -S “C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\facebook-android-wrapper-7.5.0\res” -S “C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\firebase-common-9.0.1\res” -S “C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\GoogleAIDL\res” -S “C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\GooglePlay\res” -S “C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\onesignal-unity\res” -S “C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\play-services-ads-9.0.1\res” -S “C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\play-services-ads-lite-9.0.1\res” -S “C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\play-services-base-9.0.1\res” -S “C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\play-services-basement-9.0.1\res” -S “C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\play-services-tasks-9.0.1\res” -S “C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\support-v4-23.1.1\res” -S “C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\support-v4-23.2.1\res” -S “C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\unityads-release\res”

stderr[
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\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>
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\abc_alert_dialog_button_bar_material.xml: note: using v17 attributes; synthesizing resource com.chatapp.depadstudio:layout/abc_alert_dialog_button_bar_material for configuration v17.
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\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>
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\abc_alert_dialog_material.xml: note: using v17 attributes; synthesizing resource com.chatapp.depadstudio:layout/abc_alert_dialog_material for configuration v17.
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\abc_dialog_title_material.xml:29: note: removing attribute http://schemas.android.com/apk/res/android:textAlignment from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\abc_dialog_title_material.xml: note: using v17 attributes; synthesizing resource com.chatapp.depadstudio:layout/abc_dialog_title_material for configuration v17.
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\abc_screen_toolbar.xml:27: note: removing attribute http://schemas.android.com/apk/res/android:touchscreenBlocksFocus from <android.support.v7.widget.ActionBarContainer>
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\abc_screen_toolbar.xml: note: using v21 attributes; synthesizing resource com.chatapp.depadstudio:layout/abc_screen_toolbar for configuration v21.
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\abc_search_view.xml:47: note: removing attribute http://schemas.android.com/apk/res/android:layoutDirection from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\abc_search_view.xml: note: using v17 attributes; synthesizing resource com.chatapp.depadstudio:layout/abc_search_view for configuration v17.
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_big_media.xml:42: note: removing attribute http://schemas.android.com/apk/res/android:layoutDirection from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_big_media.xml:34: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_big_media.xml:34: note: removing attribute http://schemas.android.com/apk/res/android:layout_toStartOf from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_big_media.xml: note: using v17 attributes; synthesizing resource com.chatapp.depadstudio:layout/notification_template_big_media for configuration v17.
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_big_media_narrow.xml:60: note: removing attribute http://schemas.android.com/apk/res/android:layout_toEndOf from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_big_media_narrow.xml:46: note: removing attribute http://schemas.android.com/apk/res/android:layout_toEndOf from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_big_media_narrow.xml:46: note: removing attribute http://schemas.android.com/apk/res/android:layoutDirection from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_big_media_narrow.xml:38: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_big_media_narrow.xml:38: note: removing attribute http://schemas.android.com/apk/res/android:layout_toStartOf from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_big_media_narrow.xml:30: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentEnd from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_big_media_narrow.xml: note: using v17 attributes; synthesizing resource com.chatapp.depadstudio:layout/notification_template_big_media_narrow for configuration v17.
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_lines.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:paddingEnd from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_lines.xml:77: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_lines.xml:96: note: removing attribute http://schemas.android.com/apk/res/android:paddingStart from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_lines.xml:64: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_lines.xml:27: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_lines.xml: note: using v17 attributes; synthesizing resource com.chatapp.depadstudio:layout/notification_template_lines for configuration v17.
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_media.xml:43: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginEnd from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_media.xml:33: note: removing attribute http://schemas.android.com/apk/res/android:layoutDirection from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_media.xml: note: using v17 attributes; synthesizing resource com.chatapp.depadstudio:layout/notification_template_media for configuration v17.
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_part_chronometer.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:paddingStart from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_part_chronometer.xml: note: using v17 attributes; synthesizing resource com.chatapp.depadstudio:layout/notification_template_part_chronometer for configuration v17.
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_part_time.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:paddingStart from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_part_time.xml: note: using v17 attributes; synthesizing resource com.chatapp.depadstudio:layout/notification_template_part_time for configuration v17.
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\select_dialog_multichoice_material.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:paddingStart from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\select_dialog_multichoice_material.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:paddingEnd from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\select_dialog_multichoice_material.xml: note: using v17 attributes; synthesizing resource com.chatapp.depadstudio:layout/select_dialog_multichoice_material for configuration v17.
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\select_dialog_singlechoice_material.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:paddingStart from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\select_dialog_singlechoice_material.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:paddingEnd from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\select_dialog_singlechoice_material.xml: note: using v17 attributes; synthesizing resource com.chatapp.depadstudio:layout/select_dialog_singlechoice_material for configuration v17.
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_audio_toggle.xml:2: note: removing attribute http://schemas.android.com/apk/res/android:paddingStart from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_audio_toggle.xml:61: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_audio_toggle.xml:27: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentStart from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_audio_toggle.xml:27: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_audio_toggle.xml:52: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_audio_toggle.xml:44: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_audio_toggle.xml:19: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentStart from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_audio_toggle.xml:10: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_audio_toggle.xml: note: using v17 attributes; synthesizing resource com.chatapp.depadstudio:layout/unityads_button_audio_toggle for configuration v17.
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_pause.xml:8: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_pause.xml: note: using v17 attributes; synthesizing resource com.chatapp.depadstudio:layout/unityads_button_pause for configuration v17.
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_view_video_play.xml:92: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentStart from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_view_video_play.xml:57: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentEnd from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_view_video_play.xml:57: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginEnd from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_view_video_play.xml:44: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginEnd from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_view_video_play.xml:29: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from
C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_view_video_play.xml: note: using v17 attributes; synthesizing resource com.chatapp.depadstudio:layout/unityads_view_video_play for configuration v17.
AndroidManifest.xml:30: Tag attribute authorities has invalid character ‘$’.
]
stdout[
Configurations:
(default)

Files:
drawable\unityads_background_button_pause.xml
Src: () C:\Users\b\Desktop\test\Temp\StagingArea\android-libraries\unityads-release\res\drawab

I don’t think Unity handles Android ‘preview’ tools very well. This issue should be fixed starting Unity 5.3.4p6, according to this bug that is listed in the release notes:
(788040) - Android: Buildpipe - Don’t make use of preview SDK tools installed.

They should just pick the newest (non preview) version of tools that is installed,

Hi liortal, it turns out the issue was being caused by Admob, and I fixed it by following the answers here: CommandInvokationFailure: Failed to re-package resources. Random Error · Issue #225 · googleads/googleads-mobile-unity · GitHub

Thanks a lot for your help

Cool glad u got it working

So, in short, this is not really a bug. This error was caused by having 2 support-v4.jar/.aar in the same project. Remove one and the error will be fixed.

This is a common problem when using multiple plugins, especially those which have auto-resolver (i.e. automatically add support-v4 or Google-Play-Services library to the project). This feature is convenient, but at the same time, can be a nightmare.

Also, beware of those play-services-XXX.aar, they are incompatible with google-play-services_lib. Those .aar are part of the google-play-services_lib. So, if you are going to work if a plugin that needs the library, remember to remove those .aar and keep the library, unless you know which modules the plugin needs.

1 Like

yes,below the Plugins/Android,play-services-ads-8.4.0.aar,play-services-basement-8.4.0.arr and google-play-services_lib folder.
when delete the google-play-services_lib folder,it works well!

So this not Unity bug but user error then!!

I used https://github.com/unity-plugins/google-play-game-service-unity-plugin and not this bug