【问题标题】:Could not install Xamarin.Mobile in PCL iOS Project无法在 PCL iOS 项目中安装 Xamarin.Mobile
【发布时间】:2016-11-25 11:27:50
【问题描述】:

我正在尝试通过 NuGet 在 PCL iOS 项目中安装 Xamarin.Mobile,但出现此错误!

无法安装软件包“xamstore-xamarin.mobile 0.7.1”。你是 试图将这个包安装到一个目标项目中 'Xamarin.iOS,Version=v1.0',但包不包含任何 与之兼容的程序集引用或内容文件 框架。如需更多信息,请联系包作者。

这是我的 AppDelegate

// The UIApplicationDelegate for the application. This class is responsible for launching the 
// User Interface of the application, as well as listening (and optionally responding) to 
// application events from iOS.
[Register("AppDelegate")]
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
{
    //
    // This method is invoked when the application has loaded and is ready to run. In this 
    // method you should instantiate the window, load the UI into it and then make the window
    // visible.
    //
    // You have 17 seconds to return from this method, or iOS will terminate your application.
    //
    public override bool FinishedLaunching(UIApplication app, NSDictionary options)
    {
        global::Xamarin.Forms.Forms.Init();
        Xamarin.FormsMaps.Init();
        LoadApplication(new App());

        return base.FinishedLaunching(app, options);
    }
}

我的 SDK 版本是 10.1。

Xamarin.Mobile 在 Android 项目中运行良好。

知道如何解决这个问题吗?

【问题讨论】:

    标签: ios xamarin.ios xamarin.mobile


    【解决方案1】:

    使用 Microsoft 解决问题。

    清理您的解决方案并重新构建。

    【讨论】:

    • 这不是解决方案!!还是一样的问题
    【解决方案2】:

    Xamarin.Mobile NuGet 包与 PCL 不兼容,因此出现错误。此 DLL 旨在安装到 iOS/Android/Windows 应用程序项目中。没有供 PCL 使用的跨平台 API。

    您可以将其与共享库一起使用。或者,您需要在每个平台项目中工作。

    【讨论】:

    • 我已经将 Xamarin.Mobile 安装到 iOs 项目中。我已经为 iOS 和 Android 实现了,但在 iOs 中我无法添加它。
    【解决方案3】:

    您可以尝试将 Xamarin.Mobile 添加为组件,而不是使用 NuGet 添加 Xamarin.Mobile 包。

    右键单击组件文件夹:

    在 Xamarin 组件窗口中搜索并选择 Xamarin.Mobile

    它可能会起作用!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-07-28
      • 2018-12-27
      • 1970-01-01
      • 2017-07-02
      • 2017-12-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多