2016-11-25 55 views
9

我想通過NuGet在PCL iOS項目中安裝Xamarin.Mobile,我正在處理這個錯誤!無法在PCL iOS項目中安裝Xamarin.Mobile

無法安裝軟件包'xamstore-xamarin.mobile 0.7.1'。您是 嘗試將此軟件包安裝到目標爲 'Xamarin.iOS,版本= 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項目中工作正常。

任何想法如何解決這個問題?

回答

2

不要使用NuGet添加Xamarin.Mobile軟件包,您可以嘗試添加Xamarin.Mobile作爲組件。

右鍵單擊組件文件夾:

Right click the Components folder

搜索和Xamarin組件窗口中選擇Xamarin.Mobile

Search and select Xamarin.Mobile

也許工作!

+0

Thx !!它正在工作 –

3

使用Microsoft解決問題的方法。

重新清潔您的解決方案並重新構建。

+0

OmG,這真的很有用! – Danilo

+0

這不是解決方案!仍然存在相同的問題 –

2

Xamarin.Mobile NuGet包與PCL不兼容,因此是錯誤。該DLL旨在被安裝到iOS/Android/Windows應用程序項目中。沒有用於PCL使用的跨平臺API。

您可以將其與共享庫一起使用。或者,您需要在每個平臺項目中工作。

+0

我正在將Xamarin.Mobile安裝到iOs項目中。我已經爲iOS和Android做了實現,但是在iOs中我無法添加它。 –

相關問題