- Home /
Failed to re-package resources.
I have been working on my game for a month. And this problem just occured. I did google this. But i cant solve it. This does not occur when i try to build an empty scene in another project, but only in my current project. I need help.
This is the error in the console. (i dont get much of it):
Error building Player: CommandInvokationFailure: Failed to re-package resources. See the Console for details.
C:\adt-bundle-windows-x86_64-20140702\sdk\build-tools\android-4.4W\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/adt-bundle-windows-x86_64-20140702/sdk/platforms/android-20\android.jar" -F bin/resources.ap_
stderr[
AndroidManifest.xml:9: error: Error: No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version').
]
stdout[
Configurations:
(default)
hdpi
ldpi
xhdpi
xxhdpi
Files:
drawable\app_icon.png
Src: () res\drawable\app_icon.png
Src: (hdpi) res\drawable-hdpi\app_icon.png
Src: (ldpi) res\drawable-ldpi\app_icon.png
Src: (xhdpi) res\drawable-xhdpi\app_icon.png
Src: (xxhdpi) res\drawable-xxhdpi\app_icon.png
values\strings.xml
Src: () res\values\strings.xml
AndroidManifest.xml
Src: () AndroidManifest.xml
Resource Dirs:
Type drawable
drawable\app_icon.png
Src: () res\drawable\app_icon.png
Src: (hdpi) res\drawable-hdpi\app_icon.png
Src: (ldpi) res\drawable-ldpi\app_icon.png
Src: (xhdpi) res\drawable-xhdpi\app_icon.png
Src: (xxhdpi) res\drawable-xxhdpi\app_icon.png
Type values
values\strings.xml
Src: () res\values\strings.xml
Including resources from package: C:\adt-bundle-windows-x86_64-20140702\sdk\platforms\android-20\android.jar
applyFileOverlay for drawable
applyFileOverlay for layout
applyFileOverlay for anim
applyFileOverlay for animator
applyFileOverlay for interpolator
applyFileOverlay for transition
applyFileOverlay for xml
applyFileOverlay for raw
applyFileOverlay for color
applyFileOverlay for menu
applyFileOverlay for mipmap
Processing image: res\drawable\app_icon.png
Processing image: res\drawable-hdpi\app_icon.png
Processing image: res\drawable-ldpi\app_icon.png
Processing image: res\drawable-xhdpi\app_icon.png
(processed image res\drawable-ldpi\app_icon.png: 114% size of source)
Processing image: res\drawable-xxhdpi\app_icon.png
(processed image res\drawable\app_icon.png: 104% size of source)
(processed image res\drawable-hdpi\app_icon.png: 96% size of source)
(processed image res\drawable-xhdpi\app_icon.png: 94% size of source)
(processed image res\drawable-xxhdpi\app_icon.png: 97% size of source)
(new resource id app_icon from drawable\app_icon.png #generated)
(new resource id app_icon from hdpi\drawable\app_icon.png #generated)
(new resource id app_icon from ldpi\drawable\app_icon.png #generated)
(new resource id app_icon from xhdpi\drawable\app_icon.png #generated)
(new resource id app_icon from xxhdpi\drawable\app_icon.png #generated)
]
Do you have a custom Android$$anonymous$$anifest.xml in your project ?
nope. nothing like that. i didnt touch anything to do with SD$$anonymous$$s.
Can you please list your Assets/Plugins/Android folder if there's anything there?
there was Android$$anonymous$$anifest.xml and a unity-plugin-library.jar file. i just deleted the xml file. and it worked. i never made that idk how it got there. thanks :)
and sorry. im very new to android development
Answer by liortal · Oct 20, 2014 at 01:17 PM
The issue is that you have an AndroidManifest.xml file (Probably under Plugins/Android or a plugin in a subfolder of this folder) that tries to access a resource by name (google_play_services_version), but this value is never defined anywhere.
Usually, this value is added via some method such as adding it to the AndroidManifest.xml or to an xml under res/values.
For example, see the documentation here (under Add the Google Play services version to your app's manifest).
NOTE: Sometimes, it can get a bit tricky to find out why the build fails. If all else fails, i recommend you to check out this link - it is a professional service to help fix Android related build issues (due to manifest merging, conflicting plugins, etc). Check it out if you're unable to resolve your issues !
sorry that i hadn't said that liortal's answer was correct. And your's is too. Thanks to both of you
I implemented the fix posted by liortal... it sounds good but... I now get this error.. (from the fix code) Error: No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version'). What does this mean ? Can unity not find google play services libraries or something ?
Answer by khayamgondal · Apr 07, 2015 at 04:28 AM
To fix this error, you have to copy the version.xml
file from
android-sdk/extras/google/google_play_services/libproject/google-play-services_lib/res/values/
into Assets/Plugins/Android/res/values/ of your Unity project's folder.
there isnt a google folder in my sdk.sxtras, only a android folder, sorry for my bad english, i am Chinese, so, what happened?
I didn't have a res folder in google-play-services_lib, but there were some res folders inside OTHER Folders inside google-play-services_lib. I pasted that versson.xml file into each of them and it solved the problem :D
you made it ( create folder named "values" inside the values create folder named "res")
I have the same problem as you all have. But I tried all the options possible and I can't Build and Run the app. I can't find the version.xml file, I've deleted the Android$$anonymous$$anifest.xml. If there is something I could do and you know how, it would be of great help.
CommandInvokationFailure: Failed to re-package resources. See the Console for details. C:\Users\Bautista\AppData\Local\Android\sdk\build-tools\24.0.0\aapt.exe package --auto-add-overlay -v -f -m -J gen -$$anonymous$$ Android$$anonymous$$anifest.xml -S "res" -I "C:/Users/Bautista/AppData/Local/Android/sdk\platforms\android-24\android.jar" -F bin/resources.ap_
stderr[
] stdout[
] UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String error$$anonymous$$sg) UnityEditor.Android.PostProcessAndroidPlayer.Exec (System.String command, System.String args, System.String workingdir, System.String[] progress_strings, Single progress_value, System.String error$$anonymous$$sg) 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()
This issue seems to be related to build-tools version. I had the same issue today after Android Studio upgraded build-tools to 24.0.0. Downgraded back to 23.0.2 and then it worked again.
I had the exact same issue and Downgrading back to 23.0.2 worked for me. Thank you!
Answer by pophead2 · Jun 22, 2016 at 08:36 PM
Moro! I had this issue when I was trying to push my project to Android. Here is the Fix(Founded in reddit) that worked for me.
1) Find and open your SDK Manager.exe at android-sdk folder.
2) under tool, have Android SDK tools 25.1.7 and Android SDK Platfomr-tools 24 installed.
3) uninstall Android SDK Build-tools 24 and install 23.0.1 instead.
Done.
Thanks a lot! This indeedly works! and by the way: if someone encountered the "URL NOT Found" issue in SD$$anonymous$$ manager while installing 23.0.1 on Win10, you can try run the "SD$$anonymous$$ $$anonymous$$anager.exe" as ad$$anonymous$$istrator. If this doesnt work, can still try run "C:\Program Files (x86)\Android\android-sdk\tools\android.bat" as ad$$anonymous$$istrator on Win 10 and this worked for me.
I logged in just to upvote this and thank you. I have been going through every possible solution for hours now and this finally worked. Thanks a bunch!
i did it but i have same error with 23.0.1 Please help me!
CommandInvokationFailure: Failed to re-package resources. See the Console for details. /Users/yusufguven/Documents/Android/sdk/build-tools/23.0.1/aapt package --auto-add-overlay
Hard to tell since this is not the full log. I can assist with fixing Android related issues, see here: https://www.fiverr.com/lysergide/fix-android-build-issues-in-your-unity3d-project
Answer by chaurasiyapawan · Oct 18, 2014 at 05:08 AM
I found a better solution: Copy google-play-services_lib folder to Plugins/Android, so you don't have to hard code Google Play Service's value. https://github.com/googleads/googleads-mobile-plugins/issues/11
This worked great, just want to underline that it HAS to go in the plugins/android folder (got me once hah).
i dont have the google-play-services-lib folder and i cant find where is the Plugins/Android! help me on what steps should i take to fix the error!
Answer by mubasherikram · Mar 31, 2015 at 03:08 PM
RESOLVED !!! I was facing this issue while integrating AdMob and ChartBoost via Prime[31]. his issue was resolved by following steps.
Delete all plugin Directories.
Import first plugin
import second plugin but remember to uncheck google-game-palay services_lib folder
its done
Thanks a ton mubasherikram(how to pronounce :p)
this help me a lot
Same here if you do it right it works...THAN$$anonymous$$S!!!
Thanks a lot! Otherwise, my steps was - close In app purchase services, remove Plugins folder, install admob package, install chartboost package, enable in app purchase service.
what kinda plugins? i dont have anything. i am SO confused!
Julian, things might have changed since this thread started. I also didn't find those folders. Thing is, with new android SD$$anonymous$$, things might be done in different way. check newer post for different solutions.
Your answer
Follow this Question
Related Questions
Android SDK does not include error 1 Answer
Having issue building apk 1 Answer
APK is installed but does not show the application and does not open either. 1 Answer
Error build android app 1 Answer
Failed to re-package resources using everyplay plugin and google play plugin for leaderboard 0 Answers