Xamarin wont build when adding certain images to project; what are the requirements?

EricTheriaultEricTheriault ✭✭USMember ✭✭

Hi--

I have a series of images that I use on our website that work well with Xamarin IOS -- however, as soon as I add these files to our Android project in Xamarin, the project fails to build with 110 errors regarding various missing resources. Remove the image and it works again. The images in question are about 10 images I use on our website; does not appear to be anything strange about them compared to my existing images.

Been using Xamarin for a while now and I've never seen it act this way -- any insight on what could be wrong? Are there requirements for images?

Thanks!

Eric

Answers

  • KrayemKrayem ✭✭ LYMember ✭✭

    Android drawables have naming restrictions – only lowercase letters, numbers, underscore, and period are allowed – and for cross-platform compatibility this must be followed on all the other platforms too. The example filename waterfront.png follows the rules, but examples of invalid filenames include "water front.png", "WaterFront.png", "water-front.png", and "wåterfront.png".

    https://developer.xamarin.com/guides/xamarin-forms/user-interface/images/

  • EricTheriaultEricTheriault ✭✭ USMember ✭✭

    @Krayem said:

    Android drawables have naming restrictions – only lowercase letters, numbers, underscore, and period are allowed – and for cross-platform compatibility this must be followed on all the other platforms too. The example filename waterfront.png follows the rules, but examples of invalid filenames include "water front.png", "WaterFront.png", "water-front.png", and "wåterfront.png".

    https://developer.xamarin.com/guides/xamarin-forms/user-interface/images/

    Thanks for the suggestion -- unfortunately none of these have that particular issue and it is still broken with the latest Xamarin. Sample image (and filename) in case that spurs any other ideas: https://d1t47c0c0cxsr0.cloudfront.net/resources/icons/walking.png . Thanks!

    Eric

Sign In or Register to comment.