I have developed a Xamarin.Forms
application using Visual Studio 2019. This targets iOS and Android. I have currently being developing in Debug
mode.
The application contains many svg
images which are loaded using the FFImageLoading.Svg.Forms
plugin as follows:
SvgCachedImage imageSearch = new SvgCachedImage
{
Source = "resource://AppName.Resources.add_red.svg",
WidthRequest = 25,
};
These are all saved under the AppName/Resources
folder. Each item's properties are as follows:
This works perfectly in the Android simulator, on an Android Phone and also on an iPhone simulator, all in Debug
mode.
I have now tried to create an Android APK in Release
mode.
The APK installs onto the Android phone. The application loads without any error, but all of the items in the Resources
folder are not displayed? All other elements are displayed.
I have tried:
Any ideas or suggestions on what could be causing this?
Versions:
After a lot of rummaging around and testing lots of different settings, the solution was to create a completely new solution. I was not able to find a setting that was causing the problem:
.cs
and .xaml
files into the new project folder. Don't copy the .csproj
files.The application was then first tested in Debug
mode, then in a Release
emulator. All SVG graphics loaded correctly.
Finally, an Archive and APK was made and tested on an Android phone, all worked perfectly and as expected.
I have absolutely no idea of the actual cause of this problem, but this workaround definitely saved me.