- Home /
Android build "Failed to re-package resources"
Hello! I am trying to build my game on Android for the first time, and I am having issues. While building the apk file, an error pops up saying "CommandInvokationFailure: Failed to re-package resources. See the Console for details."
Here is the full error log.
CommandInvokationFailure: Failed to re-package resources. See the Console for details.
C:\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:/Android/sdk\platforms\android-23\android.jar" -F bin/resources.ap_ --extra-packages android.support.v7.cardview:com.facebook:com.facebook.android:android.support.v4 -S "C:\projects\WordGolf\Temp\StagingArea\android-libraries\cardview-v7-23.2.1\res" -S "C:\projects\WordGolf\Temp\StagingArea\android-libraries\facebook-android-sdk-4.11.0\res" -S "C:\projects\WordGolf\Temp\StagingArea\android-libraries\facebook-android-wrapper-7.5.0\res" -S "C:\projects\WordGolf\Temp\StagingArea\android-libraries\support-v4-23.2.1\res"
stderr[
]
stdout[
Configurations:
(default)
Files:
AndroidManifest.xml
Src: () AndroidManifest.xml
Resource Dirs:
Including resources from package: C:\Android\sdk\platforms\android-23\android.jar
applyFileOverlay for drawable
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=app_banner.png
trying overlaySet Key=app_icon.png
applyFileOverlay for layout
trying overlaySet Key=com_facebook_activity_layout.xml
trying overlaySet Key=com_facebook_device_auth_dialog_fragment.xml
trying overlaySet Key=com_facebook_login_fragment.xml
trying overlaySet Key=com_facebook_tooltip_bubble.xml
trying overlaySet Key=messenger_button_send_blue_large.xml
trying overlaySet Key=messenger_button_send_blue_round.xml
trying overlaySet Key=messenger_button_send_blue_small.xml
trying overlaySet Key=messenger_button_send_white_large.xml
trying overlaySet Key=messenger_button_send_white_round.xml
trying overlaySet Key=messenger_button_send_white_small.xml
applyFileOverlay for anim
applyFileOverlay for animator
applyFileOverlay for interpolator
applyFileOverlay for transition
applyFileOverlay for xml
applyFileOverlay for raw
applyFileOverlay for color
trying overlaySet Key=com_facebook_button_text_color.xml
trying overlaySet Key=com_facebook_send_button_text_color.xml
applyFileOverlay for menu
applyFileOverlay for mipmap
Processing image: res\drawable-xhdpi\app_banner.png
Processing image: res\drawable\app_icon.png
Processing image: C:\projects\WordGolf\Temp\StagingArea\android-libraries\facebook-android-sdk-4.11.0\res\drawable-mdpi\com_facebook_Processing image: button_icoC:\projects\WordGolf\Temp\StagingArea\android-libraries\facebook-android-sdk-4.11.0\res\drawable-hdpn_i\blucoem_face.pbook_buttong
n_icon_blue.png
(processed image C:\projects\WordGolf\Temp\StagingArea\android-libraries\facebook-android-sdk-4.11.0\res\drawable-mdpi\com_facebook_button_icon_blue.png: 30% size of source)
(processed image C:\projects\WordGolf\Temp\StagingArea\android-libraries\facebook-android-sdk-4.11.0\res\drawable-hdpi\com_facebook_bu
]
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.PostProcessAndroidPlayer.Exec (System.String command, System.String args, System.String workingdir, System.String[] progress_strings, Single progress_value, System.String errorMsg)
UnityEditor.Android.PostProcessAndroidPlayer.CompileResources (System.String stagingArea, System.String packageName, UnityEditor.Android.AndroidLibraries androidLibraries)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcessInternal (System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry)
UnityEditor.HostView:OnGUI()
After researching a bit, im not sure what the problem is, sources are telling me different things. Ive tried rebuilding the AndroidManifest file, and that didn't seem to work. Can someone point me in the right direction?
Answer by Guhanesh · Jun 23, 2016 at 07:59 AM
I had the same error.For me the problem is with Android SDK. Uninstalling preview build tools (API 24) solves the problem.
Did the error started to appear after you update anything in Android SDK Manager?
Your error code contains " C:\Android\sdk\build-tools\24.0.0-preview\aapt.exe" ,"cardview-v7-23.2.1","support-v4-23.2.1".
You have API 24 build tools but all other extra libraries uses API 23.2.1.Analyse your error code again.
Uninstall API 24 build tools preview and build again it will solve your problem.
Answer by manelizzard · Jun 23, 2016 at 02:12 PM
I faced this problem some times. In my case was happening because I had two support-v4 jar libraries included in the APK (like the one included in the Facebook library and the one I added manually).
Check you have no dupped *.jar when creating the APK
Your answer
Follow this Question
Related Questions
can't build android app with facebook sdk 5 Answers
the min sdk version cannot be specified in the androidmanifest.xml file. you have to remove it. 4 Answers
Failed to re-package resources using everyplay plugin and google play plugin for leaderboard 0 Answers
Unfortunately, "GameName" has stopped. 0 Answers
Gradle build faild. see... error "in unity 2020.1.4f1!!!" 0 Answers