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

Hello Billy. After trying both the nugget package and the .dll packages I get the exact same errors. There has been no change. 

I was able to get this working by starting with a fresh project. For the time being, it is working!

Hello Sevren,


I am glad to hear you were able to make it work.


I will share this information with our Engineering team so that they will know that updating an existing project has issues but starting from scratch works OK. 


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.

Hi Billy, I will give this a go. In the meantime maybe you can help me with another blocking breakage that is keeping me from using kinvey. The was happening with v3.0.8 as well. This packaging error happens no matter what Profile I choose in the PCL options.


image


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,
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.

Hello Sevren,


Thank you for posting the update. We are looking into this and will get back with you as soon as we know more or have a solution.


Regards,


Billy Gee

Kinvey Support

Hello Sevren,


Can you please confirm which version of the Xamarin SDK you are using. I assume it is 3.0.8 but I want to be 100% certain because I have just escalated this problem to Engineering to investigate.


Regards,


Billy Gee

Kinvey Support


MLIBZ-1876

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

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

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 - 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 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

Login or Signup to post a comment