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


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


Any update on this?

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,


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.

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


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.

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