启动时偶尔找不到或无效的图片

时间:2018-04-17 23:52:11

标签: android xamarin

因此,在启动使用Xamarin Forms编写的Android应用时,我遇到了一个问题。

基本上没有任何图像在启动时加载。这种情况很少发生,并且完全随机发生。我唯一注意到的是系统在发生之前似乎暂时停止了。

Log Cat显示:

D/ActivityManager(  624): bindService callerProcessName:[App i'm starting here], calleePkgName: com.android.providers.media, action: android.media.IMediaScannerService
W/ResourceType( 3893): No package identifier when getting value for resource number 0x00000000
I/mono-stdout( 3893): FileImageSourceHandler: Could not find image or image file was invalid: File: Icons_Taskbar_logo.png
W/ResourceType( 3893): No package identifier when getting value for resource number 0x00000000
I/mono-stdout( 3893): FileImageSourceHandler: Could not find image or image file was invalid: File: Icons_Taskbar_products.png
W/ResourceType( 3893): No package identifier when getting value for resource number 0x00000000
I/mono-stdout( 3893): FileImageSourceHandler: Could not find image or image file was invalid: File: Icons_Taskbar_settings.png

1 个答案:

答案 0 :(得分:0)

我对此的解决方法是添加

ResourceManager.Init(GetType().Assembly);

作为OnCreate方法的第一行。