Cannot install Xamarin Mobile from Nuget

Keep getting this error:

Installing 'xamstore-xamarin.mobile 0.7.1'.
Successfully installed 'xamstore-xamarin.mobile 0.7.1'.
Adding 'xamstore-xamarin.mobile 0.7.1' to MobileTakePhoto.
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+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.

Can't work out whats going on?

Ps. Don't know whether this is the correct Sub-Forum for this question because its Nuget but I thought it was close enough.

Best Answer

Answers

  • ChristopherSvanefalkChristopherSvanefalk USMember ✭✭
    edited November 2014

    @mattward‌ I am confused, wasn't the purpose of Xamarin.Mobile to function similar to Xamarin.Forms, in the sense that it gives us a single API for accessing common device features such as GPS (just like Xamarin.Forms provides a single UI API) etc? I always thought it would be usable in shared projects, just like Xamarin.Forms.

  • mattwardmattward GBMember Xamurai

    @ChristopherSvanefalk‌ - The Xamarin.Mobile Component cannot currently be installed into a Portable Class Library (PCL) project since it has no PCL assemblies.

    The latest version currently available (0.7.4) supports:

    • Android
    • iOS Classic
    • iOS Unified
    • WinRT
    • Windows Phone 7
    • Windows Phone 8

    To use it from a PCL you would need to create an interface which exposes the features you need and them implement that interface in the platform specific projects.

    Shared Asset Projects is another possibility since that is set of source files that are used by your platform specific project. The Shared Asset Project does not itself have any references.

    The Xamarin.Mobile NuGet package, which is currently out of date compared with the Component from the Component Store, can only be installed into an Android or iOS Classic project.

  • BuddhimaKudagamaBuddhimaKudagama USMember ✭✭

    I solved this by
    1. Downloading package from Nuget using below link.. https://components.xamarin.com/view/xamarin.mobile?version=0.7.1

    1. Extract the downloaded zip file

    1. Then Add it to the packages or somewhere..

    2. Then add the reference to Android project

    6.Then the app will build successfully

Sign In or Register to comment.