请在特定于平台的项目中调用CachedImageRenderer.Init方法以使用FFImageLoading?

LED机

尝试在iO上使用Xamarin FFImageLoading插件时,出现以下异常:

System.Exception: Please call CachedImageRenderer.Init method in a platform specific project to use FFImageLoading!
  at FFImageLoading.Forms.CachedImage.OnSourcePropertyChanged (Xamarin.Forms.BindableObject bindable, System.Object oldValue, System.Object newValue) [0x00007] in C:\projects\ffimageloading\source\FFImageLoading.Forms\CachedImage.cs:133 
  at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00120] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:625 
  at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x0015b] in D:\a\1\s\Xam
arin.Forms.Core\BindableObject.cs:417 
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, System.Boolean fromStyle, System.Boolean checkAccess) [0x0003d] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:573 
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:99 
  at FFImageLoading.Forms.CachedImage.set_Source (Xamarin.Forms.ImageSource value) [0x00000] in C:\projects\ffimageloading\source\FFImageLoading.Forms\CachedImage.cs:173 
  at Demo.MainViewModel..ctor () [0x0001f] in <4cd5393447f94973bb9eef7c0de8880d>:0 
  at FullCameraApp.CameraPage.getLayoutImage (System.Int32 index) [0x00001] in <4cd5393447f94973bb9eef7c0de8880d>:0 
  at FullCameraApp.CameraPage..ctor (ScoreScan.webServices.WebServices webServices, System.Collections.Generic.List`1[T] imageBytesList) [0x0060b] in <4cd5393447f94973bb9eef7c0de8880d>:0 
  at ScoreScan.App..ctor () [0x0
0025] in <4cd5393447f94973bb9eef7c0de8880d>:0 
  at ScoreScan.iOS.AppDelegate.FinishedLaunching (UIKit.UIApplication app, Foundation.NSDictionary options) [0x0000d] in <4cd5393447f94973bb9eef7c0de8880d>:0 
  at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.14/src/Xamarin.iOS/UIKit/UIApplication.cs:79 
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0002c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.14/src/Xamarin.iOS/UIKit/UIApplication.cs:63 
  at ScoreScan.iOS.Application.Main (System.String[] args) [0x00001] in <4cd5393447f94973bb9eef7c0de8880d>:0 
2018-10-08 19:47:10.229 ScoreScan.iOS[324:13181] Unhandled managed exception:
Please call CachedImageRenderer.Init method in a platform specific project to use FFImageLoading! (System.Exception)
  at FFImageLoading.Forms.CachedImage.OnSourcePropertyChanged (Xamarin.Forms.BindableObject bindable, System.Object oldValue, System.Object newValue) [0x00007] in C:\projects\ffimageloading\source\FFImageLoading.Forms\CachedImage.cs:133 
  at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00120] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:625 
  at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x0015b] in D:\a
\1\s\Xamarin.Forms.Core\BindableObject.cs:417 
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, System.Boolean fromStyle, System.Boolean checkAccess) [0x0003d] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:573 
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:99 
  at FFImageLoading.Forms.CachedImage.set_Source (Xamarin.Forms.ImageSource value) [0x00000] in C:\projects\ffimageloading\source\FFImageLoading.Forms\CachedImage.cs:173 
  at Demo.MainViewModel..ctor () [0x0001f] in <4cd5393447f94973bb9eef7c0de8880d>:0 
  at FullCameraApp.CameraPage.getLayoutImage (System.Int32 index) [0x00001] in <4cd5393447f94973bb9eef7c0de8880d>:0 
  at FullCameraApp.CameraPage..ctor (ScoreScan.webServices.WebServices webServices, System.Collections.Generic.List`1[T] imageBytesList) [0x0060b] in <4cd5393447f94973bb9eef7c0de8880d>:0 
  at ScoreScan.App..ctor
ktrace:

如何解决此异常?

哈希姆

在global :: Xamarin.Forms.Forms.Init();之后调用CachedImageRenderer.Init。在iOS项目的AppDelegate.cs文件中提供的FinishedLaunching方法中。

它清楚地提到您需要在其中调用Init方法。详细信息将在FFImageLoading插件的github存储库中给出

在以下链接中提到

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

Android FFImageLoading!异常:System.Exception:请在特定平台中调用 CachedImageRenderer.Init 方法

使用PCL的跨平台项目中的特定于平台功能的项目架构

如何为跨平台的Jar调用特定于OS X的方法?

在多框架项目中使用特定于.NET Core的代码

使用平台时,指定特定于Python版本的testenv设置

我想使用dialogflow fullfilment发送特定于平台的响应

在Flutter中使用特定于平台的软件包

NativeScript:在没有多平台插件的情况下使用特定于平台的本机库?

有没有一种方法可以使用super()来调用Python中每个基类的__init__方法?

无法在多平台项目中使用kotlinx.serialization

在C ++项目中使用x86平台

Uno平台-如何使用其他项目中的UserControl?

仅在特定平台上的调用方法

有没有一种方法可以使用分支名称或git hash来调用“ Terraform init -from-module”?

在Eclipse项目中查找方法调用

是否可以使用变量从特定对象调用方法?

如何在模块中调用特定于类的方法

调用特定于类型的函数的有效方法

使用OCMockito验证init *中的方法调用

如何使用Eclipse在.JAR文件中包含特定于平台的本机库?

如何在Flutter / Dart中导入特定于平台的依赖项?(结合使用Android / iOS的Web)

使用 Boost Beast 在 SSL 连接中构建特定于平台的客户端身份验证

如何在我的R函数中使用特定于平台的软件包

我可以使用eslint获得特定于项目的自定义代码弃用消息吗?

Android 项目 - 我可以使用 init.gradle init 脚本覆盖 build.gradle 中设置的签名配置吗?

在Realm中使用特定于项目的ViewModel的最佳方法是什么?

MvvmCross,特定于平台的值转换器未被调用

Xamarin Forms-从平台项目调用共享代码方法

在这种情况下,请在我的项目中使用合适版本的程序集MSHTML进行部署