【问题标题】:Oxyplot Run Xamarin forms iOS not found ref to OxyPlot.Xamarin.iOSOxyplot 运行 Xamarin 表单 iOS 未找到参考 OxyPlot.Xamarin.iOS
【发布时间】:2015-07-21 06:51:19
【问题描述】:

我正在 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/source/mono/mcs/class/corlib/System/AppDomain.cs:706

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

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

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

问候

【问题讨论】:

    标签: ios charts xamarin oxyplot xamarin-forms


    【解决方案1】:

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

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

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

    WinPhone:OxyPlot.Xamarin.Forms.Platform.WinPhone.Forms.Init();

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

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

    见:http://forums.xamarin.com/discussion/comment/122219

    【讨论】:

    • 感谢您的回复,添加 typeof 并标记我以下错误:类型“OxyPlot.Xamarin.iOS.PlotView”在未引用的程序集中定义考虑添加对程序集“OxyPlot”的引用。 Xamarin.iOS',Version=2015.1.889.0, Culture=neutral, PublicKeyToken=null'
    • 只需删除所有 Oxyplot 包、dll 等。然后添加 OxyPlot.Xamarin.Forms 包。
    • 您好,感谢您提供的信息,解决方案是在 Oxyplot.Xamarin.iOS.dll 之外寻找并将其添加为新参考,它已经在工作了!
    • 没问题。如果它有效,您可以将此问题标记为已回答。谢谢!
    • 在当前的 Oxyplot.Xamarin.Forms 预发行版中似乎不存在命名空间 OxyPlot.Xamarin.Forms.Platform ... 对我来说这不起作用。
    猜你喜欢
    • 2018-04-06
    • 1970-01-01
    • 2023-03-06
    • 2018-10-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-26
    相关资源
    最近更新 更多