Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not install Xamarin.Mobile in PCL iOS Project

I'm trying to install Xamarin.Mobile in a PCL iOS project by NuGet and i'm gotting this error!

Could not install package 'xamstore-xamarin.mobile 0.7.1'. You are trying to install this package into a project that targets 'Xamarin.iOS,Version=v1.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

This is my 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);
    }
}

My SDK version is 10.1.

Xamarin.Mobile is working fine in Android Project.

Any idea how to fix this ?

like image 299
Pedro Franco Avatar asked Nov 25 '16 11:11

Pedro Franco


2 Answers

Use the Microsoft Resolution of problems.

Clean your Solution and Rebuild again.

like image 108
Renatto Machado Avatar answered Sep 28 '22 20:09

Renatto Machado


The Xamarin.Mobile NuGet package is not compatible with a PCL, hence the error. This DLL is meant to be installed into an iOS/Android/Windows app project. There is no cross-platform API for PCL use.

You could use this with a Shared Library instead. Or, you'll need to work in each platform project.

like image 42
therealjohn Avatar answered Sep 28 '22 20:09

therealjohn