Error when installing 'Microsoft.AspNet.WebApi.Client' package onto Xamarin project - c#

I am trying to install the 'Microsoft.AspNet.WebApi.Client' nuget package onto a Xamarin android project. This is going to be used to connect to a database and use an API to manipulate the data. This is the package I am trying to install
This is the error I am receiving. I am aware you can change it so your app targets a new version of android, but this doesn't say what version it needs to run on. Has anyone got a solution? Or any alternatives to connecting to a database without using SQLite
Thanks,

Related

How to install Microsoft.Azure.Devices NuGet package for Unity?

I was working with Unity and Hololens and tried to establish connection to Azure Iot Hub via MQTT protocol. Microsoft provides a tutorial for getting started with Azure IoT Hub in C#, but unfortunately, I encountered a problem with the tutorial:
In the picture above, I have selected Microsoft.Azure.Device NuGet package for installation. I have tried version 1.0.0 and also the latest one available, 1.2.4. The projects were automatically generated by Unity and that is probably the reason, why I do encounter this problem. Which problem? After I try to install the selected NuGet, I encounter the following error:
Could not install package 'Microsoft.Azure.Devices 1.2.4'. You are
trying to install this package into a project that targets
'.NETFramework,Version=v3.5,Profile=Unity Full v3.5', 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.
I was like, "Hmm, I must have wrong .NET framework version. I wonder if I can change that..." I tried to go to project properties like this
Microsoft advises changing .NET framework from Properties context menu item:
https://technet.microsoft.com/fi-fi/library/bb772098(v=vs.90).aspx (4.24.2017)
https://msdn.microsoft.com/en-us/library/bb398202(v=vs.100).aspx (4.24.2017)
However, this feature must be blocked by something, because the view that is supposed to open flashes white and disappears immediately. I suppose Unity doesn't like people tinkering with project properties, but what else can I do? Incompatible .NET framework issue needs to be resolved, so that the NuGet package can be installed, but how do I do that?
In short, how to install Microsoft.Azure.Devices NuGet package for Unity?
Sorry, this isn't possible due Unity's restriction to .net 3.5.
To be exactly, they use a custom version of mono-2.
You could try the new (experimental) .net 4.6 settings in Unity 5.6.
https://forum.unity3d.com/threads/upgraded-mono-net-in-editor-on-5-5-0b4.433541/

Xamarin Evolve - Errors on compilation

I just downloaded the XamarinEvolve project from GitHub and when trying to compile it on Microsoft Visual Studio Professional 2015 I got lot of errors as you can see on the following image:
Lot of these errors are related with the Google Cloud Messaging (GCM).
As you can see on the image above I downloaded the DLL from:
https://components.xamarin.com/view/googleplayservices-gcm
and added it to the project. But I think I'm still doing something wrong.
Any idea on how to fix this?
I have installed the project and build it on my machine. I have two issues with the project.
The first one is that need to have Android API 24. So, install it from Android SDK Manager.
The second one regarding the GCM. Please delete the GCM from your project using Package Manager Console using Uninstall-Package Xamarin.GooglePlayServices.Gcm. Then try reinstalling it using Install-Package Xamarin.GooglePlayServices.Gcm -Version 29.0.0.2
Clean, And Build.

Xamarin SignalR Android System.Net.Http.Extensions.dll

This is my first attempt at a Xamarin Android project. I have created a SignalR server in a console application and this is working fine. I am trying to create a Xamarin Android project in Visual Studio that can use SignalR to connect to my server. I have used nuget to add
Microsoft.AspNet.SignalR.Client
and
Newtonsoft.Json
When I try to build the project I am getting tthis error.
Error Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assemblySystem.Net.Http.Extensions, Version=1.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
Perhaps it doesn't exist in the Mono for Android profile?
I can't find anything on Nuget called
System.Net.Http.Extensions.dll
I have tried this and it works with VisualStudio 2015
I downloaded the complete package from Xamarin account which is just one step to create.
And then go to the signalR package for Xamarin, and download the complete package.
the go for the following path
yourdownlodfolder\signalr-2.1.2.2\signalr-2.1.2.2\lib\android
you will find something like
Include it in your bin folder. and than add refenrences manually .
and you are done. Now follow the steps mentioned in the above link to create HubProxy
I'm facing the same problem.
After install the SignalR Client on my Xamarin Forms PCL application, the Android app breaks on build.
I opened a issue on the github. Posted a simple repo app.
The SignalR is the major functionality, so I'm pretty much stuck.
https://github.com/SignalR/SignalR/issues/3775
In my case, to solve the problem i installed the nuget Microsoft.Net.Http and rebuild de project.

Azure Mobile Services nuget won't install in new VS 2015 project

I am trying to create an Azure Mobile Services cross platform app. I am using Xamarin.Forms, so have been trying to follow this tutorial. However, I am not getting very far... I create a new Xamarin Forms project in Visual Studio 2015 and opening the nuget manager. I try to install Azure Mobile Services into each project in the solution. But I get the following set of errors:
Unexpected error - Please file a bug report at http://bugzilla.xamarin.com. Reason: System.IO.FileNotFoundException: Could not load assembly 'Azure_Test, Version=, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile? Azure_Test.Droid
Could not install package 'Microsoft.Bcl.Build 1.0.14'. You are trying to install this package into a project that targets 'Xamarin.iOS,Version=v1.0', 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.
I have filed a bugzilla case, but it seems like a pretty straight forward thing, so I wondered if there is anything I have done wrong there is a workaround?
Had this the other day. Before you install the Mobile Services package install the Microsoft.Bcl.Build nuget package. After that, I was able to install flawlessly.

Xamarin Studio cross platform app error

At the moment I'm trying to launch empty app with cross-platform solution in Xamarin Studio.
I've tried make app with empty library project and shared library, both has same errors. Now unresolved problems are:
1) Build error:
Error XA5207: Please install package: 'Android Support Library' available in SDK installer. Java library file classes.jar doesn't exist. (XA5207) (*projectName*)
Error XA5207: Please install package: 'Android Support Library' available in SDK installer. Java library file libs/internal_impl-21.0.3.jar doesn't exist. (XA5207) (*projectName*)
This question didn't help me.
2) Some links says it could be because of old Mono.Android.Support.v4 component. My component version is 21.0.3.0. After clicking for update it says:
You are trying to install this package into a project that targets 'MonoAndroid,Version=v4.0', but the package does not contain any assembly references or content files that are compatible with that framework.
My Mono.Android assembly version is 0.0.0.0 and I dodn't know how to update it.
I've tried PCL project with PCL 4.5 - profile7. New projects builds normal, but after first project clean it gives me error about not found classes.jar file like described above. Another new PCL project still builds fine.
UPDATE
Error in PCL project occures not after clean - it occures with included Xamarin.Forms NuGet to Android project.
UPDATE
After rising target framework of android project to v4.0.3 I successfuly updated Mono.Android.Support.v4 component, but it still show me error about Please install package.
UPDATE
I'm using Windows 7 OS, same problem with all users including new user. But on another computer with Windows 8 it works. It is not a solution for me, but it can somehow help someone.
i think your java JDK and JRE not install properly and your path not set in your environment variable you must add your jdk path in that and if you are make application using cross platform then also add path SDK in your computer environmental variable. using CMD throw creating project.

Categories