Using Xamarin Forms and the NuGet FFImageloading plugin, I want to specify OS specific image paths in my XAML code like this:
<ffimageloading:CachedImage DownsampleToViewSize="False" Aspect="AspectFill">
<ffimageloading:CachedImage.Source>
<OnPlatform x:TypeArguments="ImageSource"
iOS="MyProject.iOS.Resources.header_background.png"
Android="MyProject.Droid.Resources.Drawable.header_background.png" />
</ffimageloading:CachedImage.Source>
</ffimageloading:CachedImage>
The iOS image is declared as BundleResource, while the image for Android is declared as AndroidResource. On iOS, the image is loading properly but for Android I keep getting this error:
invalid resource directory name: Error APT0000: obj/Debug/res/ myproject.droid.resources.drawable.header_background.png (APT0000) (MyProject.Android)
What is wrong? Wrong build type for image? I don't get it.