9

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 ?

Pedro Franco
  • 1,926
  • 1
  • 15
  • 37

3 Answers3

3

Use the Microsoft Resolution of problems.

Clean your Solution and Rebuild again.

Renatto Machado
  • 1,534
  • 2
  • 16
  • 33
3

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.

therealjohn
  • 2,378
  • 3
  • 23
  • 39
  • I'm installing the Xamarin.Mobile into iOs project already. I' already maked the implementation for iOS and Android, but in iOs i couldn't add it. – Pedro Franco Nov 29 '16 at 20:35
2

Instead of add the package of Xamarin.Mobile with NuGet, you can try adding Xamarin.Mobile as a component.

Right click the Components folder:

Right click the Components folder

Search and select Xamarin.Mobile on Xamarin Components window:

Search and select Xamarin.Mobile

It might work!

Bruno Serrano
  • 555
  • 1
  • 4
  • 13