Building my project on Android produces the error 'CommandInvokationFailure'.

I have installed the latest unity version and the latest Android SDK. I haven’t built my project on Android before - I believe I get an error when it generates an Android Manifest XML:

Some suggestions for this error for old versions of Android wanted the build-tools folder of a particular version deleted but this still doesn’t work. Could somebody help me out here?

CommandInvokationFailure: Failed to re-package resources.
C:\Users\price\AppData\Local\Android\sdk\build-tools\25.0.2\aapt.exe package --auto-add-overlay -v -f -m -J “gen” -M “AndroidManifest.xml” -S “res” -I “C:/Users/price/AppData/Local/Android/sdk\platforms\android-25\android.jar” -F bin/resources.ap_ --extra-packages com.onesignal:com.onesignal.onesignalsdk:com.google.android.gms.base:com.google.android.gms:com.google.android.gms.gcm:com.google.android.gms.location:android.support.v4 -S “C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\onesignal-unity\res” -S “C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\OneSignalConfig\res” -S “C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res” -S “C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-basement-8.3.0\res” -S “C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-gcm-8.3.0\res” -S “C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-location-8.3.0\res” -S “C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\support-v4-23.1.0\res”

stderr[
AndroidManifest.xml:20: Tag attribute name has invalid character ‘'. AndroidManifest.xml:51: Tag <permission> attribute name has invalid character '’.
AndroidManifest.xml:52: Tag attribute name has invalid character ‘$’.
]
stdout[
Configurations:
(default)

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

Resource Dirs:
Including resources from package: C:\Users\price\AppData\Local\Android\sdk\platforms\android-25\android.jar
applyFileOverlay for drawable
trying overlaySet Key=powered_by_google_dark.png
trying overlaySet Key=powered_by_google_light.png
trying overlaySet Key=common_full_open_on_phone.png
trying overlaySet Key=common_ic_googleplayservices.png
trying overlaySet Key=common_google_signin_btn_icon_dark.xml
trying overlaySet Key=common_google_signin_btn_icon_dark_disabled.9.png
trying overlaySet Key=common_google_signin_btn_icon_dark_focused.9.png
trying overlaySet Key=common_google_signin_btn_icon_dark_normal.9.png
trying overlaySet Key=common_google_signin_btn_icon_dark_pressed.9.png
trying overlaySet Key=common_google_signin_btn_icon_light.xml
trying overlaySet Key=common_google_signin_btn_icon_light_disabled.9.png
trying overlaySet Key=common_google_signin_btn_icon_light_focused.9.png
trying overlaySet Key=common_google_signin_btn_icon_light_normal.9.png
trying overlaySet Key=common_google_signin_btn_icon_light_pressed.9.png
trying overlaySet Key=common_google_signin_btn_text_dark.xml
trying overlaySet Key=common_google_signin_btn_text_dark_disabled.9.png
trying overlaySet Key=common_google_signin_btn_text_dark_focused.9.png
trying overlaySet Key=common_google_signin_btn_text_dark_normal.9.png
trying overlaySet Key=common_google_signin_btn_text_dark_pressed.9.png
trying overlaySet Key=common_google_signin_btn_text_light.xml
trying overlaySet Key=common_google_signin_btn_text_light_disabled.9.png
trying overlaySet Key=common_google_signin_btn_text_light_focused.9.png
trying overlaySet Key=common_google_signin_btn_text_light_normal.9.png
trying overlaySet Key=common_google_signin_btn_text_light_pressed.9.png
trying overlaySet Key=common_plus_signin_btn_icon_dark.xml
trying overlaySet Key=common_plus_signin_btn_icon_dark_disabled.9.png
trying overlaySet Key=common_plus_signin_btn_icon_dark_focused.9.png
trying overlaySet Key=common_plus_signin_btn_icon_dark_normal.9.png
trying overlaySet Key=common_plus_signin_btn_icon_dark_pressed.9.png
trying overlaySet Key=common_plus_signin_btn_icon_light.xml
trying overlaySet Key=common_plus_signin_btn_icon_light_disabled.9.png
trying overlaySet Key=common_plus_signin_btn_icon_light_focused.9.png
trying overlaySet Key=common_plus_signin_btn_icon_light_normal.9.png
trying overlaySet Key=common_plus_signin_btn_icon_light_pressed.9.png
trying overlaySet Key=common_plus_signin_btn_text_dark.xml
trying overlaySet Key=common_plus_signin_btn_text_dark_disabled.9.png
trying overlaySet Key=common_plus_signin_btn_text_dark_focused.9.png
trying overlaySet Key=common_plus_signin_btn_text_dark_normal.9.png
trying overlaySet Key=common_plus_signin_btn_text_dark_pressed.9.png
trying overlaySet Key=common_plus_signin_btn_text_light.xml
trying overlaySet Key=common_plus_signin_btn_text_light_disabled.9.png
trying overlaySet Key=common_plus_signin_btn_text_light_focused.9.png
trying overlaySet Key=common_plus_signin_btn_text_light_normal.9.png
trying overlaySet Key=common_plus_signin_btn_text_light_pressed.9.png
trying overlaySet Key=ic_onesignal_large_icon_default.png
trying overlaySet Key=ic_stat_onesignal_default.png
trying overlaySet Key=app_banner.png
trying overlaySet Key=app_icon.png
applyFileOverlay for layout
applyFileOverlay for anim
applyFileOverlay for animator
applyFileOverlay for interpolator
applyFileOverlay for transition
applyFileOverlay for xml
applyFileOverlay for raw
trying overlaySet Key=notification.wav
applyFileOverlay for color
trying overlaySet Key=common_google_signin_btn_text_dark.xml
trying overlaySet Key=common_google_signin_btn_text_light.xml
trying overlaySet Key=common_plus_signin_btn_text_dark.xml
trying overlaySet Key=common_plus_signin_btn_text_light.xml
applyFileOverlay for menu
applyFileOverlay for mipmap
Processing image: res\drawable-xhdpi\app_banner.png
Processing image: res\drawable-ldpi\app_icon.png
Processing image: res\drawable-mdpi\app_icon.png
Processing image: res\drawable-hdpi\app_icon.png
(processed image res\drawable-ldpi\app_icon.png: 96% size of source)
Processing image: res\drawable-xhdpi\app_icon.png
(processed image res\drawable-mdpi\app_icon.png: 96% size of source)
Processing image: res\drawable-xxhdpi\app_icon.png
(processed image res\drawable-hdpi\app_icon.png: 96% size of source)
(processed image res\drawable-xhdpi\app_icon.png: 96% size of source)
Processing image: res\drawable-xxxhdpi\app_icon.png
Processing image: C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-basement-8.3.0\res\drawable-mdpi\common_full_open_on_phone.png
(processed image C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-basement-8.3.0\res\drawable-mdpi\common_full_open_on_phone.png: 99% size of source)
Processing image: C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-basement-8.3.0\res\drawable-tvdpi\common_full_open_on_phone.png
(processed image C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-basement-8.3.0\res\drawable-tvdpi\common_full_open_on_phone.png: 63% size of source)
Processing image: C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-basement-8.3.0\res\drawable-hdpi\common_full_open_on_phone.png
(processed image C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-basement-8.3.0\res\drawable-hdpi\common_full_open_on_phone.png: 63% size of source)
Processing image: C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-basement-8.3.0\res\drawable-xhdpi\common_full_open_on_phone.png
(processed image C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-basement-8.3.0\res\drawable-xhdpi\common_full_open_on_phone.png: 63% size of source)
Processing image: C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-basement-8.3.0\res\drawable-xxhdpi\common_full_open_on_phone.png
(processed image C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-basement-8.3.0\res\drawable-xxhdpi\common_full_open_on_phone.png: 63% size of source)
Processing image: C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-mdpi\common_google_signin_btn_icon_dark_disabled.9.png
(processed image res\drawable-xxhdpi\app_icon.png: 95% size of source)
Processing image: C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-tvdpi\common_google_signin_btn_icon_dark_disabled.9.png
(processed image C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-mdpi\common_google_signin_btn_icon_dark_disabled.9.png: 269% size of source)
Processing image: C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-hdpi\common_google_signin_btn_icon_dark_disabled.9.png
(processed image res\drawable-xhdpi\app_banner.png: 93% size of source)
Processing image: C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-xhdpi\common_google_signin_btn_icon_dark_disabled.9.png
(processed image C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-tvdpi\common_google_signin_btn_icon_dark_disabled.9.png: 241% size of source)
Processing image: C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-xxhdpi\common_google_signin_btn_icon_dark_disabled.9.png
(processed image C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-hdpi\common_google_signin_btn_icon_dark_disabled.9.png: 267% size of source)
Processing image: C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-mdpi\common_google_signin_btn_icon_dark_focused.9.png
(processed image C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-mdpi\common_google_signin_btn_icon_dark_focused.9.png: 149% size of source)
Processing image: C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-tvdpi\common_google_signin_btn_icon_dark_focused.9.png
(processed image C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-xhdpi\common_google_signin_btn_icon_dark_disabled.9.png: 261% size of source)
Processing image: C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-hdpi\common_google_signin_btn_icon_dark_focused.9.png
(processed image C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-tvdpi\common_google_signin_btn_icon_dark_focused.9.png: 124% size of source)
Processing image: C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-xhdpi\common_google_signin_btn_icon_dark_focused.9.png
(processed image C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-xxhdpi\common_google_signin_btn_icon_dark_disabled.9.png: 243% size of source)
Processing image: C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-xxhdpi\common_google_signin_btn_icon_dark_focused.9.png
(processed image C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-hdpi\common_google_signin_btn_icon_dark_focused.9.png: 141% size of source)
Processing image: C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-mdpi\common_google_signin_btn_icon_dark_normal.9.png
(processed image C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-mdpi\common_google_signin_btn_icon_dark_normal.9.png: 154% size of source)
Processing image: C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-tvdpi\common_google_signin_btn_icon_dark_normal.9.png
(processed image C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-xhdpi\common_google_signin_btn_icon_dark_focused.9.png: 133% size of source)
Processing image: C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-hdpi\common_google_signin_btn_icon_dark_normal.9.png
(processed image res\drawable-xxxhdpi\app_icon.png: 95% size of source)
(processed image C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-tvdpi\common_google_signin_btn_icon_dark_normal.9.png: 130% size of source)
Processing image: C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-xhdpi\common_google_signin_btn_icon_dark_normal.9.png
Processing image: C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-xxhdpi\common_google_signin_btn_icon_dark_normal.9.png
(processed image C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-hdpi\common_google_signin_btn_icon_dark_normal.9.png: 142% size of source)
Processing image: C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-mdpi\common_google_signin_btn_icon_dark_pressed.9.png
(processed image C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-xxhdpi\common_google_signin_btn_icon_dark_focused.9.png: 124% size of source)
Processing image: C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-tvdpi\common_google_signin_btn_icon_dark_pressed.9.png
(processed image C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-mdpi\common_google_signin_btn_icon_dark_pressed.9.png: 149% size of source)
Processing image: C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-hdpi\common_google_signin_btn_icon_dark_pressed.9.png
(processed image C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-xhdpi\common_google_signin_btn_icon_dark_normal.9.png: 136% size of source)
Processing image: C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-xhdpi\common_google_signin_btn_icon_dark_pressed.9.png
(processed image C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-hdpi\common_google_signin_btn_icon_dark_pressed.9.png: 139% size of source)
Processing image: C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-xxhdpi\common_google_signin_btn_icon_dark_pressed.9.png
(processed image C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res\drawable-xxhdpi\common_google_signin_btn_icon_dark_normal.9.png: 126% size of source)
(processed image C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libr

What plugins are you using in your project?

Looks like one of them has an invalid character added to the manifest somehow.

Try to open the AndroidManifest.xml you have here: C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea

And post what you see there in lines 20, 51, 52.

Hi,

Thanks for your reply:

Lines 20,51 and 52 are:



So this is the reason why it’s failing, however which plugins are causing this? I think i’m only using Photon, OneSignal and Facebook API

as you can see, you have a “placeholder” text as part of the manifest - $(manifestApplicationId)

Some plugins place this token in the manifest and require you to replace it with the actual application id (see your plugins’ documentation). Some plugins actually do this automatically.

In any case - this is not a valid text to be placed in the manifest, and that is why the build fails.

NOTE: you can always contact me via the link in my signature if you’re unable to resolve this issue yourself.