Bug 26730 - Unable to install Xamarin.Mobile in PCL
Summary: Unable to install Xamarin.Mobile in PCL
Alias: None
Product: Mobile API (Preview)
Classification: Xamarin
Component: Xamarin.iOS ()
Version: Preview 0.6.3
Hardware: Other Windows
: --- normal
Target Milestone: ---
Assignee: Bill Holmes
Depends on:
Reported: 2015-02-04 09:57 UTC by David Laundav
Modified: 2017-05-23 16:38 UTC (History)
4 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description David Laundav 2015-02-04 09:57:03 UTC
After having migrated to the Unified API, I am no longer able to install Xamarin.Mobile from NuGet in my PCL. 

The error message can be seen in the bottom of the blog post.

I guess that the targets are not up to date since the migration switched from monotouch to Xamarin.iOS, and thus leaving the targets incompatible? 

On a side note, I am able to install the package from the Component Store on iOS, which is although set to version 0.7.5 rather than 0.7.1 as in the NuGet for the PCL.

Steps to reproduce:
1) Go to File -> New -> Project and select "Blank App (Xamarin.Forms.Portable)"
2) Expand the PCL node in the Solution Explorer
3) Right click on References -> Manage NuGet Packages
4) Search for Xamarin Mobile and install it

Xamarin.Mobile is installed

See the error below.

Installing 'xamstore-xamarin.mobile 0.7.1'.
Successfully installed 'xamstore-xamarin.mobile 0.7.1'.
Adding 'xamstore-xamarin.mobile 0.7.1' to Xamarin_Mobile_Test.
Uninstalling 'xamstore-xamarin.mobile 0.7.1'.
Successfully uninstalled 'xamstore-xamarin.mobile 0.7.1'.
Install failed. Rolling back...
Could not install package 'xamstore-xamarin.mobile 0.7.1'. You are trying to install this package into a project that targets 'portable-net45+win+wp80+MonoAndroid10+xamarinios10+MonoTouch10', 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.

Xamarin.Forms -
Xamarin -
Xamarin.Android -
Xamarin.iOS -

VS - 12.0.31101.00 Update 4
.NET - 4.5.51641
NuGet Package Manager - 2.8.50926.663

Windows 8.1 running under VirtualBox
Comment 1 Matt Ward 2015-02-05 06:08:47 UTC
Looking at the xamstore-xamarin.mobile 0.7.1 NuGet package it only supports:


So it is not possible to install the xamstore-xamarin.mobile 0.7.1 NuGet package into a PCL project.

Looking at the Xamarin.Mobile Component from Xamarin's Component Store it has assemblies for:

iOS Classic
iOS Unified
Windows Phone 8

So it is not possible to install the Xamarin.Mobile Component into a PCL project.

So right now I think you will have to create an interface/abstraction that your PCL uses and then implement that interface in your platform specific projects so it uses the Xamarin.Mobile API. If you need support for iOS Unified then you will have to use Xamarin.Mobile from Xamarin's Component store until the xamstore-xamarin.mobile NuGet package is updated.
Comment 2 David Laundav 2015-02-05 06:21:07 UTC
As I thought. 

Any idea of when the NuGet package will be updated to reflect the Unified API so that it is once more possible to install it in a PCL?
Comment 3 Matt Ward 2015-02-05 06:29:57 UTC
Not sure since the xamstore-xamarin.mobile NuGet package is currently maintained by Paul Betts.

The NuGet package is a wrapper around the Xamarin.Mobile Component from Xamarin's Component store. The xamstore-xamarin.mobile NuGet package could be updated so it can be installed into iOS Unified projects but it does not look like it would be possible for it to be installed into a PCL project since the Xamarin.Mobile Component does not support PCL projects.
Comment 4 Matthew Leibowitz 2017-05-23 16:38:34 UTC
Thanks for reporting this issue - we have resolved this in a way that we think is going to be better for everyone. Not only has the design of the library changed for the better, but we now have extensive support for PCL-based apps.

The Mobile API is being deprecated in favor of various plugins (which have the equivalent/same API):
 - Contacts: https://www.nuget.org/packages/Xam.Plugin.Contacts
 - Geolocator: https://www.nuget.org/packages/Xam.Plugin.Geolocator
 - Media: https://www.nuget.org/packages/Xam.Plugin.Media

This plugin model has several advantages:
 - Each plugin is independent, and can be updated as such
 - It is no longer an all-or-nothing package
 - Plugins can be mixed/replaced with other plugins that offer similar features

Thanks for using the Mobile API, and we hope that the new plugin model will enable you to produce even better mobile apps.