FFImageLoading fail to load image on iOS after upgrading from 2.1.8 to 2.2.4
See original GitHub issueHi,
I have a Xamarin.Forms project where i use FFImageLoading to load an image from a web url applying a CircleTransformation.
This is the init code:
Image = new CachedImage {
Aspect = Aspect.AspectFill,
HorizontalOptions = LayoutOptions.CenterAndExpand,
VerticalOptions = LayoutOptions.CenterAndExpand,
CacheDuration = TimeSpan.FromDays (30),
DownsampleUseDipUnits = true,
DownsampleWidth = size,
LoadingPlaceholder = DefaultImage,
ErrorPlaceholder = DefaultImage,
Transformations = new System.Collections.Generic.List<ITransformation> () {
new CircleTransformation(),
},
TransformPlaceholders = true
};
When i download the data model from my webservice i setup Image.Source = "https://censored/url/of/image.jpg"
.
With FFIMageLoading.iOS 2.1.8 everything worked, but after the upgrade to 2.2.4 i have the following exceptions:
Image loading failed: https://censored/url/of/image.jpg;188x0CircleTransformation,borderSize=0,borderHexColor= System.Exception: Could not initialize an instance of the type 'UIKit.NSDataAsset': the native 'initWithName:' method returned nil. It is possible to ignore this condition by setting MonoTouch.ObjCRuntime.Class.ThrowOnInitFailure to false.
and
Image loading failed: https://censored/url/of/image.jpg;188x0CircleTransformation,borderSize=0,borderHexColor= UIKit.UIKitThreadAccessException: UIKit Consistency error: you are calling a UIKit method that can only be invoked from the UI thread.
I attach a file with the full stack trace. Thank you for you help.
FFImageLoading_upgrade_error.txt
- Edit - I also tried removing the CircleTransformation but the issue wasn’t there.
Issue Analytics
- State:
- Created 7 years ago
- Comments:24 (8 by maintainers)
Top GitHub Comments
I see the same issue using version 2.2.9 throwing UIKitThreadAccessException on iOS 10 when using a LoadingPlaceholder or ErrorPlaceholder from asset catalog
In my case I can confirm that the issue has been resolved in the latest pre-228 release. Thanks for that!!