Start a new topic

kinvey PCL package will not install in Xamarin / Could not load assembly PubNub-Messaging

After creating a new Xamarin PCL app, the core PCL project will not allow the Kinvey NuGet package to be installed. Here is the error message.

image


Here is my project PCL setup.

image


Here is the setup of the PCL in the KXStarterApp (identical to mine)

image


They are identical. The only difference that I see between the sample app and mine is that the sample app uses xaml ui and I am using C# ui. Why can I not get the package to install?


UPDATE


I was able to resolve this by downloading and installing the xamarin package .dll's directly from here (http://devcenter.kinvey.com/xamarin/downloads). Now I am stuck on this error. 


/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'PubNub-Messaging, Version=1.0.6201.20023, Culture=neutral, PublicKeyToken=dc66f52ce6619f44'. Perhaps it doesn't exist in the Mono for Android profile?


2 people have this question

John - Not quite: I've only been working with a PCL project in Visual Studio 2017 and the nuget install always fails.

Hi,


Further information, I am using windows Visual Studio 2015.  When creating a new Shared Project the second install of Kinvey NUGET packages fail, the first works.  So I am now just working with a PCL project which appears to be holding together.


Harry does match your experience?


Cheers,

John.

Hi,
Just wondering if there has been any update on this as I'm having the exact same issue with v3.0.12. Have also tried the workaround suggested.


Thanks.

Hi Guys,

Are the developers able to advise what versions of 'System.Net.Primitives'  and PubnubNetPlatform to build the Kinvey.3.0.11?


Cheers,

John.

Hi,


I am also having this issue after upgrading the Kinvey version due to the double login issue.


Attempting to gather dependency information for package 'Kinvey.3.0.11' with respect to project 'PrecisionAppNative.Droid', targeting 'MonoAndroid,Version=v7.1' Gathering dependency information took 36.04 sec Attempting to resolve dependencies for package 'Kinvey.3.0.11' with DependencyBehavior 'Lowest' Resolving dependency information took 0 ms Resolving actions to install package 'Kinvey.3.0.11' Resolved actions to install package 'Kinvey.3.0.11' Retrieving package 'Kinvey 3.0.11' from 'nuget.org'. Found package 'SQLite.Net-PCL 3.1.1' in 'C:\dev\Projects\Precision\packages'. Retrieving package 'PubnubNetPlatform 3.8.7' from 'nuget.org'. Package 'SQLite.Net-PCL.3.1.1' already exists in folder 'C:\dev\Projects\Precision\packages' Added package 'SQLite.Net-PCL.3.1.1' to 'packages.config' Successfully installed 'SQLite.Net-PCL 3.1.1' to PrecisionAppNative.Droid Adding package 'PubnubNetPlatform.3.8.7' to folder 'C:\dev\Projects\Precision\packages' Added package 'PubnubNetPlatform.3.8.7' to folder 'C:\dev\Projects\Precision\packages' Install failed. Rolling back... Package 'PubnubNetPlatform.3.8.7 : NETStandard.Library [1.6.0, ), Newtonsoft.Json [9.0.1, ), System.Linq.Queryable [4.0.1, ), System.Net.Requests [4.0.11, ), System.Reflection.Primitives [4.0.1, ), System.Reflection.TypeExtensions [4.1.0, ), System.Security.Cryptography.Algorithms [4.2.0, ), System.Security.Cryptography.Primitives [4.0.0, ), System.Text.Encoding [4.0.11, ), System.Text.Encoding.Extensions [4.0.11, ), System.Threading.ThreadPool [4.0.10, )' does not exist in project 'PrecisionAppNative.Droid' Removed package 'SQLite.Net-PCL.3.1.1 : SQLite.Net.Core-PCL [3.1.1, )' from 'packages.config' Removing package 'PubnubNetPlatform.3.8.7 : NETStandard.Library [1.6.0, ), Newtonsoft.Json [9.0.1, ), System.Linq.Queryable [4.0.1, ), System.Net.Requests [4.0.11, ), System.Reflection.Primitives [4.0.1, ), System.Reflection.TypeExtensions [4.1.0, ), System.Security.Cryptography.Algorithms [4.2.0, ), System.Security.Cryptography.Primitives [4.0.0, ), System.Text.Encoding [4.0.11, ), System.Text.Encoding.Extensions [4.0.11, ), System.Threading.ThreadPool [4.0.10, )' from folder 'C:\dev\Projects\Precision\packages' Removed package 'PubnubNetPlatform.3.8.7 : NETStandard.Library [1.6.0, ), Newtonsoft.Json [9.0.1, ), System.Linq.Queryable [4.0.1, ), System.Net.Requests [4.0.11, ), System.Reflection.Primitives [4.0.1, ), System.Reflection.TypeExtensions [4.1.0, ), System.Security.Cryptography.Algorithms [4.2.0, ), System.Security.Cryptography.Primitives [4.0.0, ), System.Text.Encoding [4.0.11, ), System.Text.Encoding.Extensions [4.0.11, ), System.Threading.ThreadPool [4.0.10, )' from folder 'C:\dev\Projects\Precision\packages' Executing nuget actions took 4.59 min Failed to add reference. The package 'PubnubNetPlatform' tried to add a framework reference to 'System.Net.Primitives' which was not found in the GAC. This is possibly a bug in the package. Please contact the package owners for assistance. ========== Finished ========== Time Elapsed: 00:05:23.7456875


Are you able to assign?


I love the concept of the product - and looking forward to be able to get it all working from end-to-end.


Cheers,

John.

Hello Michael, 


This problem was originally reported using the Kinvey Xamarin SDK v3.0.8. The current release that is available for download is Xamarin SDK v3.0.11 and can be found at the following URL.


http://devcenter.kinvey.com/xamarin/downloads


There were and number of issues resolved in the subsequent release of v3.0.8. Our recommendation is that you download and install SDK v3.0.11 and attempt to reproduce this problem. If it still exists then we will continue with the debugging efforts, however, I have been told that there is a good chance that the 3.0.11 release will resolve the installation problem.


We look forward to hearing back from you.


Regards,


Billy Gee

Kinvey Support

Hi Billy,


Any update on this?

Hello Michael,


Thank you for confirming that the re-install did not work. I will add this to the engineering escalation.


Regards,


Billy Gee

Hi Billy,

I too am having this issue through Visual Studio on Windows for my PCL project. Strangely though I only get the following error when trying to deploy to a device:

1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(747,3): error : Failed to resolve assembly: 'PubNub-Messaging, Version=1.0.6201.20023, Culture=neutral, PublicKeyToken=dc66f52ce6619f44'

 I don't see this issue when deploying on the iOS simulator. This only appears to be a problem since 3.0.9 previously I was on 3.0.6. I tried your method of uninstalling the kinvey PCL package and dependencies then installing PubnubNetPlatform package then the Kinvey pcl package; this unfortunately did not resolve the issue.

Hello Everyone,


We are still investigating this problem but in the meantime, we have a workaround that might help.


We believe that this problem is a Windows-only issue. If anyone thinks differently, please feel free to share your thoughts as we would like to hear them.


We also believe the issue is with the order in which the packages are installed. As a workaround, we suggest that you remove all your NuGet packages, install PubnubNetPlatform.3.8.7, and then install the Kinvey SDK v3.0.9. We believe that the package dependencies will then resolve correctly. 

 

Note that even with the suggested workaround, we are still investigating this problem and will continue to update you as we make progress.

 


We look forward to hearing from you with respect to the results of the suggested workaround.


Regards,


Billy Gee


Billy - Just FYI,


I've tried this on Visual Studio for Mac and the packages add correctly for Android.  This seems to be a problem purely on the windows version if this helps.


Thanks


Ramesh

Billy,


Thanks for the very prompt response - I've tried this with v3.0.9 and am experiencing the same issue.  I also tried to install System.Net.Primitives separately before installing the Kinvey package, but this had similiar problems.


Error message below:

Failed to add reference. The package 'PubnubNetPlatform' tried to add a framework reference to 'System.Net.Primitives' which was not found in the GAC. This is possibly a bug in the package. Please contact the package owners for assistance. 

  Error HRESULT E_FAIL has been returned from a call to a COM component.


Thanks!


Ramesh

Billy,


Thanks for the very prompt response!  I've tried this with v3.0.9 and still having the same issue.  Output from the package manager is copied below:

-----------------------------------------------------------------------------

Attempting to gather dependency information for package 'Kinvey-Android.3.0.9' with respect to project 'CashereBuyer', targeting 'MonoAndroid,Version=v7.1'

Gathering dependency information took 25.01 sec

Attempting to resolve dependencies for package 'Kinvey-Android.3.0.9' with DependencyBehavior 'Lowest'

Resolving dependency information took 0 ms

Resolving actions to install package 'Kinvey-Android.3.0.9'

Resolved actions to install package 'Kinvey-Android.3.0.9'

  GET https://api.nuget.org/packages/xamarin.android.support.v4.23.0.1.3.nupkg

Retrieving package 'Kinvey 3.0.9' from 'nuget.org'.

Retrieving package 'Kinvey-Android 3.0.9' from 'nuget.org'.

Retrieving package 'Microsoft.Bcl 1.1.10' from 'nuget.org'.

Retrieving package 'Microsoft.Bcl.Async 1.0.168' from 'nuget.org'.

Retrieving package 'Microsoft.Bcl.Build 1.0.21' from 'nuget.org'.

Retrieving package 'Microsoft.Net.Http 2.2.29' from 'nuget.org'.

Retrieving package 'Microsoft.NETCore.Platforms 1.0.1' from 'nuget.org'.

Retrieving package 'Microsoft.Win32.Primitives 4.0.1' from 'nuget.org'.

Retrieving package 'modernhttpclient 2.4.2' from 'nuget.org'.

Retrieving package 'NETStandard.Library 1.6.0' from 'nuget.org'.

Retrieving package 'Newtonsoft.Json 9.0.1' from 'nuget.org'.

Retrieving package 'PubnubNetPlatform 3.8.7' from 'nuget.org'.

...

Adding package 'PubnubNetPlatform.3.8.7' to folder 'I:\Work_Local\TwoManTent\Cashere\CashereBuyer\packages'

Added package 'PubnubNetPlatform.3.8.7' to folder 'I:\Work_Local\TwoManTent\Cashere\CashereBuyer\packages'

Install failed. Rolling back...

....

Failed to add reference. The package 'PubnubNetPlatform' tried to add a framework reference to 'System.Net.Primitives' which was not found in the GAC. This is possibly a bug in the package. Please contact the package owners for assistance.

  Error HRESULT E_FAIL has been returned from a call to a COM component.


I also tried to add the System.Net.Primitives package separately before installing the Kinvey-android package but this didn't work also.


Thanks


Ramesh

Hello Sevren and Ramesh,


We have a new version of Xamarin SDK v3.0.9 available at the following location. We're not 100% certain it will fix this problem but it is worth a try to upgrade and test to find out. The release can be found at the following URL.


http://devcenter.kinvey.com/xamarin/downloads


We look forward to hearing back from you with results.


Regards,


Billy Gee

Hi Sevren,


I'm having the same issue on Visual Studio Community 2017 with Xamarin for Android.  The NuGet package returns the same error on the pubnubnetplatform reference.


I also had the same issue when I tried to install the Kinvey dll's manually into a fresh solution.  Has there been any further on this with engineering?


Thanks


Ramesh

Login or Signup to post a comment