CommandInvokationFailure: Failed to re-package resources

I see manny thread in forums talk about this but i can find any work solution for my case, so i posted new thread to disscus and hope for a solution!

In my case, i can build releash apk, and run perfectly on devices, but, when i try to export unity project to google android project, i got this error

Please help me!

CommandInvokationFailure: Failed to re-package resources. See the Console for details. D:\Code\ADT\WorkingSpace\Work\sdk\build-tools\23.0.1\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S “res” -I “D:/Code/ADT/WorkingSpace/Work/sdk\platforms\android-23\android.jar” -F bin/resources.ap_ --extra-packages com.google.firebase:com.google.unity:com.google.example.games.mainlibproj -S “C:\Users\TLSOFT01\Documents\gameunity\Temp\StagingArea\android-libraries\firebase-common-9.0.1\res”

stderr[ AndroidManifest.xml:17: error: Error: No resource found that matches the given name (at ‘theme’ with value ’ @ /Theme.IAPTheme’).

AndroidManifest.xml:19: error: Error: No resource found that matches the given name (at ‘value’ with value ’ @Integer /google_play_services_version’).

In your AndroidManifest.xml , you are referencing certain resources using an ID. This is Android’s way of allowing you to define certain values and then reference them from other locations.

In the errors you posted, it looks like the following resources are used:

@ /Theme.IAPTheme
@Integer /google_play_services_version

When the Android build system tries to build this, it will look for any resources (the first one - a style setting, the second - an integer) and try to get its value.

If you did not define these anywhere, it will fail.

If you include google play (and google play games) as a JAR, note that these do not contain any resource definitions, only compiled code. You should include google play services as a library project, this will give you access to all the resources it defines.

thanks for you help
it helped me

Please help me! CommandInvokationFailure: Failed to re-package resources. See the Console for details.

CommandInvokationFailure: Failed to re-package resources.
C:\ANDROID_SDK24\build-tools\25.0.2\aapt.exe package --auto-add-overlay -v -f -m -J “gen” -M “AndroidManifest.xml” -S “res” -I “C:/ANDROID_SDK24\platforms\android-24\android.jar” -F bin/resources.ap_ --extra-packages android.support.v7.appcompat:android.support.v7.cardview:com.facebook:com.facebook:com.facebook.android:com.facebook.android:com.google.unity:com.google.android.gms.ads.impl:com.google.android.gms.ads:com.google.android.gms.base:com.google.android.gms:com.google.android.gms.clearcut:com.google.android.gms.gass:com.google.android.gms.tasks:android.support.v4:android.support.v4 -S “C:\Users\UFUK\Desktop\VECIHI_FACEBOOK\vecihi android\final_game\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res” -S “C:\Users\UFUK\Desktop\VECIHI_FACEBOOK\vecihi android\final_game\Temp\StagingArea\android-libraries\cardview-v7-23.1.1\res” -S “C:\Users\UFUK\Desktop\VECIHI_FACEBOOK\vecihi android\final_game\Temp\StagingArea\android-libraries\facebook-android-sdk-4.8.2\res” -S “C:\Users\UFUK\Desktop\VECIHI_FACEBOOK\vecihi android\final_game\Temp\StagingArea\android-libraries\facebook-android-sdk-4.9.0\res” -S “C:\Users\UFUK\Desktop\VECIHI_FACEBOOK\vecihi android\final_game\Temp\StagingArea\android-libraries\facebook-android-wrapper-7.4.0\res” -S “C:\Users\UFUK\Desktop\VECIHI_FACEBOOK\vecihi android\final_game\Temp\StagingArea\android-libraries\facebook-android-wrapper-release\res” -S “C:\Users\UFUK\Desktop\VECIHI_FACEBOOK\vecihi android\final_game\Temp\StagingArea\android-libraries\play-services-ads-10.2.0\res” -S “C:\Users\UFUK\Desktop\VECIHI_FACEBOOK\vecihi android\final_game\Temp\StagingArea\android-libraries\play-services-ads-lite-10.2.0\res” -S “C:\Users\UFUK\Desktop\VECIHI_FACEBOOK\vecihi android\final_game\Temp\StagingArea\android-libraries\play-services-base-10.2.0\res” -S “C:\Users\UFUK\Desktop\VECIHI_FACEBOOK\vecihi android\final_game\Temp\StagingArea\android-libraries\play-services-basement-10.2.0\res” -S “C:\Users\UFUK\Desktop\VECIHI_FACEBOOK\vecihi android\final_game\Temp\StagingArea\android-libraries\play-services-clearcut-10.2.0\res” -S “C:\Users\UFUK\Desktop\VECIHI_FACEBOOK\vecihi android\final_game\Temp\StagingArea\android-libraries\play-services-gass-10.2.0\res” -S “C:\Users\UFUK\Desktop\VECIHI_FACEBOOK\vecihi android\final_game\Temp\StagingArea\android-libraries\play-services-tasks-10.2.0\res” -S “C:\Users\UFUK\Desktop\VECIHI_FACEBOOK\vecihi android\final_game\Temp\StagingArea\android-libraries\support-v4-23.1.1\res” -S “C:\Users\UFUK\Desktop\VECIHI_FACEBOOK\vecihi android\final_game\Temp\StagingArea\android-libraries\support-v4-24.0.0\res”

stderr[
C:\Users\UFUK\Desktop\VECIHI_FACEBOOK\vecihi android\final_game\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\abc_screen_toolbar.xml: note: using v21 attributes; synthesizing resource com.gamePlace.Vecihi:layout/abc_screen_toolbar for configuration v21.
C:\Users\UFUK\Desktop\VECIHI_FACEBOOK\vecihi android\final_game\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\UFUK\Desktop\VECIHI_FACEBOOK\vecihi android\final_game\Temp\StagingArea\android-libraries\facebook-android-sdk-4.8.2\res\values\values.xml:18: error: Attribute “com_facebook_foreground_color” has already been defined

C:\Users\UFUK\Desktop\VECIHI_FACEBOOK\vecihi android\final_game\Temp\StagingArea\android-libraries\facebook-android-sdk-4.8.2\res\values\values.xml:18: error: Attribute “com_facebook_object_id” has already been defined

C:\Users\UFUK\Desktop\VECIHI_FACEBOOK\vecihi android\final_game\Temp\StagingArea\android-libraries\facebook-android-sdk-4.8.2\res\values\values.xml:18: error: Attribute “com_facebook_object_type” has already been defined

C:\Users\UFUK\Desktop\VECIHI_FACEBOOK\vecihi android\final_game\Temp\StagingArea\android-libraries\facebook-android-sdk-4.8.2\res\values\values.xml:18: error: Attribute “com_facebook_style” has already been defined

C:\Users\UFUK\Desktop\VECIHI_FACEBOOK\vecihi android\final_game\Temp\StagingArea\android-libraries\facebook-android-sdk-4.8.2\res\values\values.xml:18: error: Attribute “com_facebook_auxiliary_view_position” has already been defined

C:\Users\UFUK\Desktop\VECIHI_FACEBOOK\vecihi android\final_game\Temp\StagingArea\android-libraries\facebook-android-sdk-4.8.2\res\values\values.xml:18: error: Attribute “com_facebook_horizontal_alignment” has already been defined

C:\Users\UFUK\Desktop\VECIHI_FACEBOOK\vecihi android\final_game\Temp\StagingArea\android-libraries\facebook-android-sdk-4.8.2\res\values\values.xml:19: error: Attribute “com_facebook_confirm_logout” has already been defined

C:\Users\UFUK\Desktop\VECIHI_FACEBOOK\vecihi android\final_game\Temp\StagingArea\android-libraries\facebook-android-sdk-4.8.2\res\values\values.xml:19: error: Attribute “com_facebook_login_text” has already been defined

C:\Users\UFUK\Desktop\VECIHI_FACEBOOK\vecihi android\final_game\Temp\StagingArea\android-libraries\facebook-android-sdk-4.8.2\res\values\values.xml:19: error: Attribute “com_facebook_logout_text” has already been defined

C:\Users\UFUK\Desktop\VECIHI_FACEBOOK\vecihi android\final_game\Temp\StagingArea\android-libraries\facebook-android-sdk-4.8.2\res\values\values.xml:19: error: Attribute “com_facebook_tooltip_mode” has already been defined

C:\Users\UFUK\Desktop\VECIHI_FACEBOOK\vecihi android\final_game\Temp\StagingArea\android-libraries\facebook-android-sdk-4.8.2\res\values\values.xml:20: error: Attribute “com_facebook_preset_size” has already been defined

C:\Users\UFUK\Desktop\VECIHI_FACEBOOK\vecihi android\final_game\Temp\StagingArea\android-libraries\facebook-android-sdk-4.8.2\res\values\values.xml:20: error: Attribute “com_facebook_is_cropped” has already been defined

]
stdout[
Configurations:
(default)

Files:
AndroidManifest.xml
Src: () AndroidManifest.xml

Resource Dirs:
Including resources from package: C:\ANDROID_SDK24\platforms\android-24\android.jar
applyFileOverlay for drawable
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_focused.xml
trying overlaySet Key=common_google_signin_btn_icon_dark_normal.xml
trying overlaySet Key=common_google_signin_btn_icon_dark_normal_background.9.png
trying overlaySet Key=common_google_signin_btn_icon_disabled.xml
trying overlaySet Key=common_google_signin_btn_icon_light.xml
trying overlaySet Key=common_google_signin_btn_icon_light_focused.xml
trying overlaySet Key=common_google_signin_btn_icon_light_normal.xml
trying overlaySet Key=common_google_signin_btn_icon_light_normal_background.9.png
trying overlaySet Key=common_google_signin_btn_text_dark.xml
trying overlaySet Key=common_google_signin_btn_text_dark_focused.xml
trying overlaySet Key=common_google_signin_btn_text_dark_normal.xml
trying overlaySet Key=common_google_signin_btn_text_dark_normal_background.9.png
trying overlaySet Key=common_google_signin_btn_text_disabled.xml
trying overlaySet Key=common_google_signin_btn_text_light.xml
trying overlaySet Key=common_google_signin_btn_text_light_focused.xml
trying overlaySet Key=common_google_signin_btn_text_light_normal.xml
trying overlaySet Key=common_google_signin_btn_text_light_normal_background.9.png
trying overlaySet Key=googleg_disabled_color_18.png
trying overlaySet Key=googleg_standard_color_18.png
trying overlaySet Key=com_facebook_auth_dialog_background.xml
trying overlaySet Key=com_facebook_auth_dialog_cancel_background.xml
trying overlaySet Key=com_facebook_auth_dialog_header_background.xml
trying overlaySet Key=com_facebook_button_background.xml
trying overlaySet Key=com_facebook_button_icon.xml
trying overlaySet Key=com_facebook_button_icon_blue.png
trying overlaySet Key=com_facebook_button_icon_white.png
trying overlaySet Key=com_facebook_button_like_background.xml
trying overlaySet Key=com_facebook_button_like_icon_selected.png
trying overlaySet Key=com_facebook_button_login_silver_background.xml
trying overlaySet Key=com_facebook_button_send_background.xml
trying overlaySet Key=com_facebook_button_send_icon_blue.png
trying overlaySet Key=com_facebook_button_send_icon_white.png
trying overlaySet Key=com_facebook_close.png
trying overlaySet Key=com_facebook_favicon_white.png
trying overlaySet Key=com_facebook_profile_picture_blank_portrait.png
trying overlaySet Key=com_facebook_profile_picture_blank_square.png
trying overlaySet Key=com_facebook_send_button_icon.xml
trying overlaySet Key=com_facebook_tooltip_black_background.9.png
trying overlaySet Key=com_facebook_tooltip_black_bottomnub.png
trying overlaySet Key=com_facebook_tooltip_black_topnub.png
trying overlaySet Key=com_facebook_tooltip_black_xout.png
trying overlaySet Key=com_facebook_tooltip_blue_background.9.png
trying overlaySet Key=com_facebook_tooltip_blue_bottomnub.png
trying overlaySet Key=com_facebook_tooltip_blue_topnub.png
trying overlaySet Key=com_facebook_tooltip_blue_xout.png
trying overlaySet Key=messenger_bubble_large_blue.png
trying overlaySet Key=messenger_bubble_large_white.png
trying overlaySet Key=messenger_bubble_small_blue.png
trying overlaySet Key=messenger_bubble_small_white.png
trying overlaySet Key=messenger_button_blue_bg_round.xml
trying overlaySet Key=messenger_button_blue_bg_selector.xml
trying overlaySet Key=messenger_button_send_round_shadow.png
trying overlaySet Key=messenger_button_white_bg_round.xml
trying overlaySet Key=messenger_button_white_bg_selector.xml
trying overlaySet Key=com_facebook_button_background.xml
baseFile 0 has flavor
overlayFile 0 has flavor
found a match (0) for overlay file com_facebook_button_background.xml, for flavor
trying overlaySet Key=com_facebook_button_icon.png
trying overlaySet Key=com_facebook_button_like_background.xml
baseFile 0 has flavor
overlayFile 0 has flavor
found a match (0) for overlay file com_facebook_button_like_background.xml, for flavor
trying overlaySet Key=com_facebook_button_like_icon_selected.png
baseFile 0 has flavor mdpi-v4
baseFile 1 has flavor hdpi-v4
baseFile 2 has flavor xhdpi-v4
baseFile 3 has flavor xxhdpi-v4
overlayFile 0 has flavor mdpi-v4
overlayFile 1 has flavor hdpi-v4
overlayFile 2 has flavor xhdpi-v4
overlayFile 3 has flavor xxhdpi-v4
found a match (0) for overlay file com_facebook_button_like_icon_selected.png, for flavor mdpi-v4
found a match (1) for overlay file com_facebook_button_like_icon_selected.png, for flavor hdpi-v4
found a match (2) for overlay file com_facebook_button_like_icon_selected.png, for flavor xhdpi-v4
found a match (3) for overlay file com_facebook_button_like_icon_selected.png, for flavor xxhdpi-v4
trying overlaySet Key=com_facebook_button_login_silver_background.xml
baseFile 0 has flavor
overlayFile 0 has flavor
found a match (0) for overlay file com_facebook_button_login_silver_background.xml, for flavor
trying overlaySet Key=com_facebook_button_send_background.xml
baseFile 0 has flavor
overlayFile 0 has flavor
found a match (0) for overlay file com_facebook_button_send_background.xml, for flavor
trying overlaySet Key=com_facebook_button_send_icon.png
trying overlaySet Key=com_facebook_close.png
baseFile 0 has flavor mdpi-v4
baseFile 1 has flavor hdpi-v4
baseFile 2 has flavor xhdpi-v4
overlayFile 0 has flavor mdpi-v4
overlayFile 1 has flavor hdpi-v4
overlayFile 2 has flavor xhdpi-v4
found a match (0) for overlay file com_facebook_close.png, for flavor mdpi-v4
found a match (1) for overlay file com_facebook_close.png, for flavor hdpi-v4
found a match (2) for overlay file com_facebook_close.png, for flavor xhdpi-v4
trying overlaySet Key=com_facebook_profile_picture_blank_portrait.png
baseFile 0 has flavor mdpi-v4
overlayFile 0 has flavor mdpi-v4
found a match (0) for overlay file com_facebook_profile_picture_blank_portrait.png, for flavor mdpi-v4
trying overlaySet Key=com_facebook_profile_picture_blank_square.png
baseFile 0 has flavor mdpi-v4
overlayFile 0 has flavor mdpi-v4
found a match (0) for overlay file com_facebook_profile_picture_blank_square.png, for flavor mdpi-v4
trying overlaySet Key=com_facebook_tooltip_black_background.9.png
baseFile 0 has flavor mdpi-v4
baseFile 1 has flavor hdpi-v4
baseFile 2 has flavor xhdpi-v4
overlayFile 0 has flavor mdpi-v4
overlayFile 1 has flavor hdpi-v4
overlayFile 2 has flavor xhdpi-v4
found a match (0) for overlay file com_facebook_tooltip_black_background.9.png, for flavor mdpi-v4
found a match (1) for overlay file com_facebook_tooltip_black_background.9.png, for flavor hdpi-v4
found a match (2) for overlay file com_facebook_tooltip_black_background.9.png, for flavor xhdpi-v4
trying overlaySet Key=com_facebook_tooltip_black_bottomnub.png
baseFile 0 has flavor mdpi-v4
baseFile 1 has flavor hdpi-v4
baseFile 2 has flavor xhdpi-v4
overlayFile 0 has flavor mdpi-v4
overlayFile 1 has flavor hdpi-v4
overlayFile 2 has flavor xhdpi-v4
found a match (0) for overlay file com_facebook_tooltip_black_bottomnub.png, for flavor mdpi-v4
found a match (1) for overlay file com_facebook_tooltip_black_bottomnub.png, for flavor hdpi-v4
found a match (2) for overlay file com_facebook_tooltip_black_bottomnub.png, for flavor xhdpi-v4
trying overlaySet Key=com_facebook_tooltip_black_topnub.png
baseFile 0 has flavor mdpi-v4
baseFile 1 has flavor hdpi-v4
baseFile 2 has flavor xhdpi-v4
overlayFile 0 has flavor mdpi-v4
overlayFile 1 has flavor hdpi-v4
overlayFile 2 has flavor xhdpi-v4
found a match (0) for overlay file com_facebook_tooltip_black_topnub.png, for flavor mdpi-v4
found a match (1) for overlay file com_facebook_tooltip_black_topnub.png, for flavor hdpi-v4
found a match (2) for overlay file com_facebook_tooltip_black_topnub.png, for flavor xhdpi-v4
trying overlaySet Key=com_facebook_tooltip_black_xout.png
baseFile 0 has flavor mdpi-v4
baseFile 1 has flavor hdpi-v4
baseFile 2 has flavor xhdpi-v4
overlayFile 0 has flavor mdpi-v4
overlayFile 1 has flavor hdpi-v4
overlayFile 2 has flavor xhdpi-v4
found a match (0) for overlay file com_facebook_tooltip_black_xout.png, for flavor mdpi-v4
found a match (1) for overlay file com_facebook_tooltip_black_xout.png, for flavor hdpi-v4
found a match (2) for overlay file com_facebook_tooltip_black_xout.png, for flavor xhdpi-v4
trying overlaySet Key=com_facebook_tooltip_blue_background.9.png
baseFile 0 has flavor mdpi-v4
baseFile 1 has flavor hdpi-v4
baseFile 2 has flavor xhdpi-v4
overlayFile 0 has flavor mdpi-v4
overlayFile 1 has flavor hdpi-v4
overlayFile 2 has flavor xhdpi-v4
found a match (0) for overlay file com_facebook_tooltip_blue_background.9.png, for flavor mdpi-v4
found a match (1) for overlay file com_facebook_tooltip_blue_background.9.png, for flavor hdpi-v4
found a match (2) for overlay file com_facebook_tooltip_blue_background.9.png, for flavor xhdpi-v4
trying overlaySet Key=com_facebook_tooltip_blue_bottomnub.png
baseFile 0 has flavor mdpi-v4
baseFile 1 has flavor hdpi-v4
baseFile 2 has flavor xhdpi-v4
overlayFile 0 has flavor mdpi-v4
overlayFile 1 has flavor hdpi-v4
overlayFile 2 has flavor xhdpi-v4
found a match (0) for overlay file com_facebook_tooltip_blue_bottomnub.png, for flavor mdpi-v4
found a match (1) for overlay file com_facebook_tooltip_blue_bottomnub.png, for flavor hdpi-v4
found a match (2) for overlay file com_facebook_tooltip_blue_bottomnub.png, for flavor xhdpi-v4
trying overlaySet Key=com_facebook_tooltip_blue_topnub.png
baseFile 0 has flavor mdpi-v4
baseFile 1 has flavor hdpi-v4
baseFile 2 has flavor xhdpi-v4
overlayFile 0 has flavor mdpi-v4
overlayFile 1 has flavor hdpi-v4
overlayFile 2 has flavor xhdpi-v4
found a match (0) for overlay file com_facebook_tooltip_blue_topnub.png, for flavor mdpi-v4
found a match (1) for overlay file com_facebook_tooltip_blue_topnub.png, for flavor hdpi-v4
found a match (2) for overlay file com_facebook_tooltip_blue_topnub.png, for flavor xhdpi-v4
trying overlaySet Key=com_facebook_tooltip_blue_xout.png
baseFile 0 has flavor mdpi-v4
baseFile 1 has flavor hdpi-v4
baseFile 2 has flavor xhdpi-v4
overlayFile 0 has flavor mdpi-v4
overlayFile 1 has flavor hdpi-v4
overlayFile 2 has flavor xhdpi-v4
found a match (0) for overlay file com_facebook_to

Do you have multiple copies of the Facebook SDK by any chance?

thanks for reply but I have only facebook-unity-sdk-7.4.0

From the log you sent it seems you have this library:
facebook-android-sdk-4.8.2

check if you have any other copy of this library (maybe with a different version?)

I deleted all plugins and facebook sdk sources and after import facebook sdk again, so I still have not solved the problem

I am not sure, this is what i saw in the error message. You can always contact me via the link in my signature. I help solving this kind of errors (although its a paid service). You can keep this in mind, as a “last resort”.

thank you so much !