I have a Visual Studio (Xamarin, Android) project with a file which has an accent character in the name:
diário.png
This file is in the Assets folder, and marked as an Android Asset.
Unfortunately when I build the project, I get a compile error:
C:\Users\vchel\Documents\FlatRedBallProjects\AndroidSpecialCharacter\AndroidSpecialCharacter\obj\Debug\assets\content\gumproject\dißrio.png : error : Invalid filename. Unable to add.
Notice that the file is diário.png in my project, but the error references it as dißrio.png.
If I rename the file to diario.png (no accent above the letter a) the project builds fine.
I know I could work around this by not using accent characters in my file but this seems like a strange restriction. Is this a known issue? Is there another way to solve this other than avoiding using accents in file names?
Asset naming restrictions are bound all the way back to Android API 1
, the related build tools and .apk
packaging (and has nothing to due with the Xamarin framework).
Valid characters for naming resources are [a-z, _, 0–9]
Use an underscore (_
) as a multi-name separator between "words" in your assets
The first letter can be either _ or a small case character
Note: There used to be notes on these restrictions on the Android Developer site, but I can no longer find them as they stripped out most docs for the build tools