0

我正在 Xamarin Forms 中创建一个应用程序,我将使用 OxyPlot 显示图表,在 Android 和 Windows Phone 上运行 Hello World OxyPlot,但我遇到了 IOS 问题。当模拟器加载应用程序时,会发送以下内容:

{System.IO.FileNotFoundException:无法加载文件或程序集'OxyPlot.Xamarin.iOS'}

和堆栈:

System.AppDomain.Load (assemblyRef={OxyPlot.Xamarin.iOS, Version=2015.1.889.0, Culture=neutral, PublicKeyToken=null}, assemblySecurity=(null)) 在 /Users/builder/data/lanes/1962/8b265d64/源/单声道/mcs/class/corlib/System/AppDomain.cs:706

似乎没有提到 Packete Oxyplot.xamarin.iOS 但不是如何解决它。

我在每个平台中添加了 Nuget 预发布的 OxyPlot Xamarin Forms。正如我在android和windows phone(使用visual studio)中提到的那样工作正常。

感谢您的关注,如果需要更多数据,请继续关注。

问候

4

1 回答 1

0

确保已安装https://www.nuget.org/packages/OxyPlot.Xamarin.Forms/。然后,您需要通过在之前添加以下调用来初始化 OxyPlot 渲染器Xamarin.Forms.Forms.Init()

IOS:OxyPlot.Xamarin.Forms.Platform.iOS.Forms.Init();

安卓:OxyPlot.Xamarin.Forms.Platform.Android.Forms.Init();

赢手机:OxyPlot.Xamarin.Forms.Platform.WinPhone.Forms.Init();

或者

由于 Xamarin 链接器,程序集可能会被切断。添加:

var ignoreOxyplot = typeof(OxyPlot.Xamarin.Forms.Platform.iOS.PlotViewRenderer)在 iOS 项目FinishedLaunching方法中。

请参阅:http ://forums.xamarin.com/discussion/comment/122219

于 2015-07-21T14:24:16.677 回答