NabeelSaleem NabeelSaleem - 1 month ago 8
Android Question

Android - Error building Player: CommandInvokationFailure: Failed to re-package resources

I am getting this error when i try to build my game for android. But it successfully built to webplayer. i checked everything is right,

and one think recently i upgrade my unity to 4.5.1

Error details are:

Error building Player: CommandInvokationFailure: Failed to re-package resources. See the Console for details.
D:\adt-bundle-windows-x86_64-20131030\adt-bundle-windows-x86_64-20131030\sdk\build-tools\android-4.4\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "D:/adt-bundle-windows-x86_64-20131030/adt-bundle-windows-x86_64-20131030/sdk/platforms/android-18\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: D:\adt-bundle-windows-x86_64-20131030\adt-bundle-windows-x86_64-20131030\sdk\platforms\android-18\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-hdpi\app_icon.png
Processing image: res\drawable\app_icon.png
(processed image res\drawable\app_icon.png: 97% size of source)
Processing image: res\drawable-ldpi\app_icon.png
(processed image res\drawable-ldpi\app_icon.png: 98% size of source)
Processing image: res\drawable-xhdpi\app_icon.png
(processed image res\drawable-hdpi\app_icon.png: 98% size of source)
Processing image: res\drawable-xxhdpi\app_icon.png
(processed image res\drawable-xhdpi\app_icon.png: 98% size of source)
(processed image res\drawable-xxhdpi\app_icon.png: 98% 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)
]

Answer

What i did and it worked.

i had only jre not jdk. First i download jdk from oracle site.
set up environments path:

JAVA_HOME
C:\Program Files (x86)\Java\jdk1.8.0_11\bin

but error exist again.

========================================

Then i got this guide: try this and tell if it works.

copy zipalign.exe file from > D:\adt-bundle-windows-x86_64-20131030\adt-bundle-windows-x86_64-20140702\adt-bundle-windows-x86_64-20140702\sdk\build-tools\android-4.4W

or where ever you have it and then Past to > D:\adt-bundle-windows-x86_64-20131030\adt-bundle-windows-x86_64-20140702\adt-bundle-windows-x86_64-20140702\sdk\tools

Unity3diy forums

And everything works perfect :)

Comments