Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

How to find the image that is not found on iOS

$
0
0

Hi all,

I get this error:
System.Exception: Could not initialize an instance of the type 'MonoTouch.UIKit.UIImage': the native 'initWithContentsOfFile:' method returned nil.
It is possible to ignore this condition by setting MonoTouch.ObjCRuntime.Class.ThrowOnInitFailure to false.
at MonoTouch.Foundation.NSObject.InitializeHandle (IntPtr handle, System.String initSelector) [0x000b0] in /Developer/MonoTouch/Source/maccore/src/Foundation/NSObject2.cs:399
at MonoTouch.UIKit.UIImage..ctor (System.String filename) [0x00026] in /Developer/MonoTouch/Source/monotouch/src/build/compat/UIKit/UIImage.g.cs:239
at Xamarin.Forms.Platform.iOS.FileImageSourceHandler.LoadImageAsync (Xamarin.Forms.ImageSource imagesource, CancellationToken cancelationToken, Single scale) [0x00000] in :0
at Xamarin.Forms.Platform.iOS.ImageRenderer+d__0.MoveNext () [0x00000] in :0

But only on a real device, not in the simulator. So best bet is that somewhere the filename case is wrong, or it might call Bundleresource instead of FileResource. I checked all filenames, and they seem to be OK. I checked multiple levels of the exception data to find any indication of the filename that is missing or is giving a problem. But as this is loaded async, settings breakpoints and debug messages did not help.

I checked if all files are set to BundleResource, and they are referred to by using ImageSource.FromFile (image-name)

Who is giving me a hint which image or resource could give me this trouble?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>