Bug 26263 - Adding NuGet package to Forms solution fails
Summary: Adding NuGet package to Forms solution fails
Status: RESOLVED ANSWERED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.3.2
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Matt Ward
URL:
Depends on:
Blocks:
 
Reported: 2015-01-21 23:54 UTC by Louis Taljaard
Modified: 2015-01-22 06:19 UTC (History)
4 users (show)

Tags:
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:
Status:
RESOLVED ANSWERED

Description Louis Taljaard 2015-01-21 23:54:42 UTC
When I try to add NuGet package Couchbase Lite to my new Xamarin Forms solution, I get the following error:

Could not install package 'SQLitePCL.raw_basic 0.7.1'. You are trying to install this package into a project that targets 'portable-net40+sl50+win+wp80+MonoTouch10+MonoAndroid10+xamarinmac20+xamarinios10', 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 seems to be similar to the following: http://kb.xamarin.com/customer/portal/articles/1772629-you-are-trying-to-install-this-package-into-a-project-that-targets-xamarin-ios10

But that thread seems to be a Visual Studio specific issue, whereas I'm getting this error from within the latest version of Xamarin Studio on a Mac (in that thread, they advise to manually update your NuGet Package Manager installed with Visual Studio, but for Xamarin Studio I presume NuGet Package Manager will also be updated when Xamarin Studio auto-updates to the latest version - or is this assumption wrong, and if so, how do I update NuGet Package Manager manually for a Xamarin Studio installation?).

My Xamarin Studio version is 5.7 (build 661).

Rgds,
Louis
Comment 1 Matt Ward 2015-01-22 04:29:34 UTC
Xamarin Studio ships with its own NuGet Package Manager unlike Visual Studio so you do not need to update it separately.

Looking at the SQLitePCL.raw_basic 0.7.1 NuGet package it does not have a Portable Class Library profile that supports .NET 4.0. The closest PCL profile that SQLitePCL.raw_basic has compared to what you have is:

   portable-net45+sl5+win+wp8+MonoAndroid10+MonoTouch10+Xamarin.iOS10

This needs your PCL project to have a PCL profile profile compatible with .NET 4.5. To be able to install SQLitePCL.raw_basic you will need to change the PCL profile of your PCL project. Profile 78 seems to work and is the default profile used by the latest Xamarin.Forms project template in Xamarin Studio 5.7.
Comment 2 Louis Taljaard 2015-01-22 06:05:18 UTC
Hi Matt

Ok, I've now created a new Forms solution called "cblite_try1" and chose Blank App (Xamarin.Forms Portable). That defaults to Profile 78 as you mentioned. That generates a solution with three projects inside it: cblite_try1 (the shared PCL Forms one), cblite_try1.Droid and cblite_try1.iOS

But when I add Couchbase Lite to the cblite_try1 project, it gives the below error. It succeeds in adding the dependencies (SQLitePCL.raw_basic and a few others) but it fails on package Couchbase.Lite 1.0.4.1 (the error is visible in the last line of the log below):

Adding Couchbase.Lite...
Attempting to resolve dependency 'SQLitePCL.raw_basic (≥ 0.7.1)'.
Attempting to resolve dependency 'SQLitePCL.ugly (≥ 0.7.1)'.
Attempting to resolve dependency 'Newtonsoft.Json (≥ 6.0.4)'.
Couchbase.Lite Package contains PowerShell scripts which will not be run.
Installing 'SQLitePCL.raw_basic 0.7.1'.
Added file 'sqlite3.dll' to folder 'SQLitePCL.raw_basic.0.7.1/build/native/sqlite3_dynamic/winxp/x86'.
Added file 'sqlite3.dll' to folder 'SQLitePCL.raw_basic.0.7.1/build/native/sqlite3_dynamic/winxp/x64'.
Added file 'sqlite3.dll' to folder 'SQLitePCL.raw_basic.0.7.1/build/native/sqlite3_dynamic/winrt80/arm'.
Added file 'sqlite3.dll' to folder 'SQLitePCL.raw_basic.0.7.1/build/native/sqlite3_dynamic/winrt80/x64'.
Added file 'sqlite3.dll' to folder 'SQLitePCL.raw_basic.0.7.1/build/native/sqlite3_dynamic/winrt80/x86'.
Added file 'sqlite3.dll' to folder 'SQLitePCL.raw_basic.0.7.1/build/native/sqlite3_dynamic/winrt81/arm'.
Added file 'sqlite3.dll' to folder 'SQLitePCL.raw_basic.0.7.1/build/native/sqlite3_dynamic/winrt81/x64'.
Added file 'sqlite3.dll' to folder 'SQLitePCL.raw_basic.0.7.1/build/native/sqlite3_dynamic/winrt81/x86'.
Added file 'sqlite3.dll' to folder 'SQLitePCL.raw_basic.0.7.1/build/native/sqlite3_dynamic/wp80/arm'.
Added file 'sqlite3.dll' to folder 'SQLitePCL.raw_basic.0.7.1/build/native/sqlite3_dynamic/wp80/x86'.
Added file 'sqlite3.dll' to folder 'SQLitePCL.raw_basic.0.7.1/build/native/sqlite3_dynamic/wp81_rt/arm'.
Added file 'sqlite3.dll' to folder 'SQLitePCL.raw_basic.0.7.1/build/native/sqlite3_dynamic/wp81_rt/x86'.
Added file 'sqlite3.dll' to folder 'SQLitePCL.raw_basic.0.7.1/build/native/sqlite3_dynamic/wp81_sl/arm'.
Added file 'sqlite3.dll' to folder 'SQLitePCL.raw_basic.0.7.1/build/native/sqlite3_dynamic/wp81_sl/x86'.
Added file 'SQLitePCL.raw.dll' to folder 'SQLitePCL.raw_basic.0.7.1/lib/portable-net45+netcore45+wp8+MonoAndroid10+MonoTouch10+Xamarin.iOS10'.
Added file 'SQLitePCL.raw.dll' to folder 'SQLitePCL.raw_basic.0.7.1/lib/portable-net45+netcore45+wpa81+wp8+MonoAndroid10+MonoTouch10+Xamarin.iOS10'.
Added file 'SQLitePCL.raw.dll' to folder 'SQLitePCL.raw_basic.0.7.1/lib/portable-net45+sl5+netcore45+wp8+MonoAndroid10+MonoTouch10+Xamarin.iOS10'.
Added file 'SQLitePCL.raw.dll' to folder 'SQLitePCL.raw_basic.0.7.1/lib/portable-net45+netcore45+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10'.
Added file 'SQLitePCL.raw.dll' to folder 'SQLitePCL.raw_basic.0.7.1/lib/MonoTouch'.
Added file 'SQLitePCL.raw.dll' to folder 'SQLitePCL.raw_basic.0.7.1/lib/Xamarin.iOS10'.
Added file 'SQLitePCL.raw.dll' to folder 'SQLitePCL.raw_basic.0.7.1/lib/MonoAndroid'.
Added file 'SQLitePCL.raw.dll' to folder 'SQLitePCL.raw_basic.0.7.1/lib/net45'.
Added file 'SQLitePCL.raw_basic.targets' to folder 'SQLitePCL.raw_basic.0.7.1/build/net45'.
Added file 'SQLitePCL.raw.dll' to folder 'SQLitePCL.raw_basic.0.7.1/lib/netcore45'.
Added file 'SQLitePCL.raw.pri' to folder 'SQLitePCL.raw_basic.0.7.1/lib/netcore45'.
Added file 'SQLitePCL.raw_basic.targets' to folder 'SQLitePCL.raw_basic.0.7.1/build/netcore45'.
Added file 'SQLitePCL.raw.dll' to folder 'SQLitePCL.raw_basic.0.7.1/lib/netcore451'.
Added file 'SQLitePCL.raw.pri' to folder 'SQLitePCL.raw_basic.0.7.1/lib/netcore451'.
Added file 'SQLitePCL.raw_basic.targets' to folder 'SQLitePCL.raw_basic.0.7.1/build/netcore451'.
Added file 'SQLitePCL.raw.dll' to folder 'SQLitePCL.raw_basic.0.7.1/lib/wpa81'.
Added file 'SQLitePCL.raw.pri' to folder 'SQLitePCL.raw_basic.0.7.1/lib/wpa81'.
Added file 'SQLitePCL.raw_basic.targets' to folder 'SQLitePCL.raw_basic.0.7.1/build/wpa81'.
Added file 'SQLitePCL.raw.dll' to folder 'SQLitePCL.raw_basic.0.7.1/build/wp8/cppinterop_sqlite3_dynamic/arm'.
Added file 'SQLitePCL.cppinterop.dll' to folder 'SQLitePCL.raw_basic.0.7.1/build/wp8/cppinterop_sqlite3_dynamic/arm'.
Added file 'SQLitePCL.cppinterop.winmd' to folder 'SQLitePCL.raw_basic.0.7.1/build/wp8/cppinterop_sqlite3_dynamic/arm'.
Added file 'SQLitePCL.raw.dll' to folder 'SQLitePCL.raw_basic.0.7.1/build/wp8/cppinterop_sqlite3_dynamic/x86'.
Added file 'SQLitePCL.cppinterop.dll' to folder 'SQLitePCL.raw_basic.0.7.1/build/wp8/cppinterop_sqlite3_dynamic/x86'.
Added file 'SQLitePCL.cppinterop.winmd' to folder 'SQLitePCL.raw_basic.0.7.1/build/wp8/cppinterop_sqlite3_dynamic/x86'.
Added file '_._' to folder 'SQLitePCL.raw_basic.0.7.1/lib/wp8'.
Added file 'SQLitePCL.raw_basic.targets' to folder 'SQLitePCL.raw_basic.0.7.1/build/wp8'.
Added file 'SQLitePCL.raw.dll' to folder 'SQLitePCL.raw_basic.0.7.1/build/wp81/cppinterop_sqlite3_dynamic/arm'.
Added file 'SQLitePCL.cppinterop.dll' to folder 'SQLitePCL.raw_basic.0.7.1/build/wp81/cppinterop_sqlite3_dynamic/arm'.
Added file 'SQLitePCL.cppinterop.pri' to folder 'SQLitePCL.raw_basic.0.7.1/build/wp81/cppinterop_sqlite3_dynamic/arm'.
Added file 'SQLitePCL.cppinterop.winmd' to folder 'SQLitePCL.raw_basic.0.7.1/build/wp81/cppinterop_sqlite3_dynamic/arm'.
Added file 'SQLitePCL.raw.dll' to folder 'SQLitePCL.raw_basic.0.7.1/build/wp81/cppinterop_sqlite3_dynamic/x86'.
Added file 'SQLitePCL.cppinterop.dll' to folder 'SQLitePCL.raw_basic.0.7.1/build/wp81/cppinterop_sqlite3_dynamic/x86'.
Added file 'SQLitePCL.cppinterop.pri' to folder 'SQLitePCL.raw_basic.0.7.1/build/wp81/cppinterop_sqlite3_dynamic/x86'.
Added file 'SQLitePCL.cppinterop.winmd' to folder 'SQLitePCL.raw_basic.0.7.1/build/wp81/cppinterop_sqlite3_dynamic/x86'.
Added file '_._' to folder 'SQLitePCL.raw_basic.0.7.1/lib/wp81'.
Added file 'SQLitePCL.raw_basic.targets' to folder 'SQLitePCL.raw_basic.0.7.1/build/wp81'.
Added file 'SQLitePCL.raw_basic.0.7.1.nupkg' to folder 'SQLitePCL.raw_basic.0.7.1'.
Successfully installed 'SQLitePCL.raw_basic 0.7.1'.
Installing 'SQLitePCL.ugly 0.7.1'.
Added file 'SQLitePCL.ugly.dll' to folder 'SQLitePCL.ugly.0.7.1/lib/portable-net45+netcore45+wp8+MonoAndroid10+MonoTouch10+Xamarin.iOS10'.
Added file 'SQLitePCL.ugly.dll' to folder 'SQLitePCL.ugly.0.7.1/lib/portable-net45+netcore45+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10'.
Added file 'SQLitePCL.ugly.dll' to folder 'SQLitePCL.ugly.0.7.1/lib/portable-net45+netcore45+wpa81+wp8+MonoAndroid10+MonoTouch10+Xamarin.iOS10'.
Added file 'SQLitePCL.ugly.0.7.1.nupkg' to folder 'SQLitePCL.ugly.0.7.1'.
Successfully installed 'SQLitePCL.ugly 0.7.1'.
Installing 'Newtonsoft.Json 6.0.4'.
Added file 'Newtonsoft.Json.dll' to folder 'Newtonsoft.Json.6.0.4/lib/net20'.
Added file 'Newtonsoft.Json.xml' to folder 'Newtonsoft.Json.6.0.4/lib/net20'.
Added file 'Newtonsoft.Json.dll' to folder 'Newtonsoft.Json.6.0.4/lib/net35'.
Added file 'Newtonsoft.Json.xml' to folder 'Newtonsoft.Json.6.0.4/lib/net35'.
Added file 'Newtonsoft.Json.dll' to folder 'Newtonsoft.Json.6.0.4/lib/net40'.
Added file 'Newtonsoft.Json.xml' to folder 'Newtonsoft.Json.6.0.4/lib/net40'.
Added file 'Newtonsoft.Json.dll' to folder 'Newtonsoft.Json.6.0.4/lib/net45'.
Added file 'Newtonsoft.Json.xml' to folder 'Newtonsoft.Json.6.0.4/lib/net45'.
Added file 'Newtonsoft.Json.dll' to folder 'Newtonsoft.Json.6.0.4/lib/netcore45'.
Added file 'Newtonsoft.Json.xml' to folder 'Newtonsoft.Json.6.0.4/lib/netcore45'.
Added file 'Newtonsoft.Json.dll' to folder 'Newtonsoft.Json.6.0.4/lib/portable-net40+sl5+wp80+win8+wpa81'.
Added file 'Newtonsoft.Json.xml' to folder 'Newtonsoft.Json.6.0.4/lib/portable-net40+sl5+wp80+win8+wpa81'.
Added file 'Newtonsoft.Json.dll' to folder 'Newtonsoft.Json.6.0.4/lib/portable-net45+wp80+win8+wpa81'.
Added file 'Newtonsoft.Json.xml' to folder 'Newtonsoft.Json.6.0.4/lib/portable-net45+wp80+win8+wpa81'.
Added file 'install.ps1' to folder 'Newtonsoft.Json.6.0.4/tools'.
Added file 'Newtonsoft.Json.6.0.4.nupkg' to folder 'Newtonsoft.Json.6.0.4'.
Successfully installed 'Newtonsoft.Json 6.0.4'.
Installing 'Couchbase.Lite 1.0.4.1'.
Added file 'Couchbase.Lite.dll' to folder 'Couchbase.Lite.1.0.4.1/lib/net45'.
Added file 'Couchbase.Lite.dll.mdb' to folder 'Couchbase.Lite.1.0.4.1/lib/net45'.
Added file 'Couchbase.Lite.xml' to folder 'Couchbase.Lite.1.0.4.1/lib/net45'.
Added file 'Couchbase.Lite.dll' to folder 'Couchbase.Lite.1.0.4.1/lib/MonoAndroid'.
Added file 'Couchbase.Lite.dll.mdb' to folder 'Couchbase.Lite.1.0.4.1/lib/MonoAndroid'.
Added file 'Couchbase.Lite.xml' to folder 'Couchbase.Lite.1.0.4.1/lib/MonoAndroid'.
Added file 'Couchbase.Lite.dll' to folder 'Couchbase.Lite.1.0.4.1/lib/xamarinios10'.
Added file 'Couchbase.Lite.dll.mdb' to folder 'Couchbase.Lite.1.0.4.1/lib/xamarinios10'.
Added file 'Couchbase.Lite.xml' to folder 'Couchbase.Lite.1.0.4.1/lib/xamarinios10'.
Added file 'Couchbase.Lite.1.0.4.1.nupkg' to folder 'Couchbase.Lite.1.0.4.1'.
Successfully installed 'Couchbase.Lite 1.0.4.1'.
Adding 'SQLitePCL.raw_basic 0.7.1' to cblite_try1.
For adding package 'SQLitePCL.raw_basic 0.7.1' to project 'cblite_try1' that targets 'portable-net45+win+wp80+MonoTouch10+MonoAndroid10+xamarinmac20+xamarinios10',
>> Assembly references are being added from 'lib/portable-net45+netcore45+wp8+MonoAndroid10+MonoTouch10+Xamarin.iOS10'
Added reference 'SQLitePCL.raw' to project 'cblite_try1'.
Added file 'packages.config'.
Added file 'packages.config' to project 'cblite_try1'.
Successfully added 'SQLitePCL.raw_basic 0.7.1' to cblite_try1.
Adding 'SQLitePCL.ugly 0.7.1' to cblite_try1.
For adding package 'SQLitePCL.ugly 0.7.1' to project 'cblite_try1' that targets 'portable-net45+win+wp80+MonoTouch10+MonoAndroid10+xamarinmac20+xamarinios10',
>> Assembly references are being added from 'lib/portable-net45+netcore45+wp8+MonoAndroid10+MonoTouch10+Xamarin.iOS10'
Added reference 'SQLitePCL.ugly' to project 'cblite_try1'.
Added file 'packages.config'.
Added file 'packages.config' to project 'cblite_try1'.
Successfully added 'SQLitePCL.ugly 0.7.1' to cblite_try1.
Adding 'Newtonsoft.Json 6.0.4' to cblite_try1.
For adding package 'Newtonsoft.Json 6.0.4' to project 'cblite_try1' that targets 'portable-net45+win+wp80+MonoTouch10+MonoAndroid10+xamarinmac20+xamarinios10',
>> Assembly references are being added from 'lib/portable-net45+wp80+win8+wpa81'
Added reference 'Newtonsoft.Json' to project 'cblite_try1'.
Added file 'packages.config'.
Added file 'packages.config' to project 'cblite_try1'.
Successfully added 'Newtonsoft.Json 6.0.4' to cblite_try1.
Adding 'Couchbase.Lite 1.0.4.1' to cblite_try1.
Could not install package 'Couchbase.Lite 1.0.4.1'. You are trying to install this package into a project that targets 'portable-net45+win+wp80+MonoTouch10+MonoAndroid10+xamarinmac20+xamarinios10', 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.
Comment 3 Matt Ward 2015-01-22 06:19:30 UTC
Unfortunately it looks like Couchbase.Lite 1.0.4.1 does not support PCL Projects. It only has assemblies for:

MonoAndroid
.Net 4.5
Xamarin.iOS

Looking at the Couchbase.Lite GitHub page there is an issue about PCL support but it is closed and looking at the latest NuGet .nuspec file there is no recent update to support installing it in a PCL project.

https://github.com/couchbase/couchbase-lite-net/issues/5

You may have to resort in creating your own interface/abstraction and use that in the PCL project and use Couchbase.Lite in your Android and iOS projects.