NuGet downgrade warning - xamarin.forms

I am new to Xamarin.Android and I want to know how to work on this issue in Visual Studio
What does this warning mean?
Warning NU1605 Detected package downgrade: Xamarin.Forms from
4.2.0.848062 to 4.2.0.709249. Reference the package directly from the project to select a different version. App1.Android -> App1 ->
Xamarin.Forms (>= 4.2.0.848062) App1.Android -> Xamarin.Forms (>=
4.2.0.709249) App1.Android C:\Users\Synergy Mobile App 1\source\repos\App1\App1\App1.Android\App1.Android.csproj

Let's start with documentation of this warning
What can help you get rid of this warning
Check if you all your project have reference to the same Xamarin.Forms version.
In order to do that:
Expand your Core
Go to Dependendencies -> Nuget
Look for Xamarin.Forms nuget package
When you find it, in the bracket you will have its version
Repeat the steps for your Xamarin.Android project.
If the versions are not the same update the one that is lower, so they are the same.

Related

error NU1102: Unable to find package Microsoft.AspNetCore.Localization with version (>= 2.2.0)

In my build pipeline, I have a step as follows:
SDK version I'm using in global.json is 3.1.201". With this, when I try to create a build, I get the following error:
error NU1102: Unable to find package Microsoft.AspNetCore.Localization with version (>= 2.2.0)
error NU1102: - Found 9 version(s) in Microsoft Visual Studio Offline Packages [ Nearest version: 1.1.3 ]
I don't know if this is related sdk version. Can someone help with fixing this issue?
Adding this step and also adding the step NUGET Installer before and switching from visual_studio 2017 to windows 2019 as the build agent solved the problem for me.
Strangely when creating a new pipeline from template "Azure function" the Nuget Restore step is missing...
Can you add step to restore nuget packages. I don't see this one on attached screen.

Cannot install some packages on Xamarin Forms project (netstandard2.0)

I am trying to add some packages and I am getting the same error all the time. Below is the error when installing Google Ads:
Package Xamarin.GooglePlayServices.Ads.Lite 60.1142.1 is not
compatible with netstandard2.0 (.NETStandard,Version=v2.0). Package
Xamarin.GooglePlayServices.Ads.Lite 60.1142.1 supports: monoandroid80
(MonoAndroid,Version=v8.0)
I am getting the same if I try to install Compat packages.
Visual Studio for Mac 7.5.2
Project Target Framework: .NET Standard 2.0
Android Target Framework: Android 8.1 (Oreo)
Android Manifest sdks: android:minSdkVersion="19" android:targetSdkVersion="27"
Can anybody give me some advice as I have been changing some parameters and trying to install other versions of the packages (which should work) but I am getting alway the same problem.
Should that package (google ads) be installed only in the Android project or in the main project as well?
Package Xamarin.GooglePlayServices
Is designed only for Android projects. Don't add it to your PCL or iOS project. Only add it to your Android Project.
It is android platform specific lib, so it must be only in Droid project
This worked for me:
Remove any "Xamarin.GooglePlayServices.*" packages.
Clean solution
Add latest "Xamarin.GooglePlayServices" package
Restart VS
Clean Solution
Rebuild
Run

This package may not be fully compatible with your project

Hi Guys I am using visual studio 2017 to build Xamarin.Forms mobile app.
I installed 'Microsoft.Net.Http 2.2.29' Package from NuGet packages
but i got this warning message :
Package 'Microsoft.Net.Http 2.2.29' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project.
How can I fix it ??
The Solution is delete the reference and use the HttpClient declared in Namespace: System.Net.Http. its worked with me and no warning message:)

Xamarin.Forms downgrade package issue

I'm using Xamarin.Forms. I updated all Xamarin.Android.Support package in my VS project. So when I realize updating Xamarin.Android.Support package in Xamarin.Forms is a mistake, I remove all package and install Xamarin.Forms last version and let it to install the dependencies in other word downgrade the dependencies to 23.3.0 version. So now, when I clean and rebuild my solution I get this error.
This project references NuGet package(s) that are missing on this
computer. Use NuGet Package Restore to download them. For more
information, see http://go.microsoft.com/fwlink/?LinkID=322105. The
missing file is
....\packages\Xamarin.Android.Support.Compat.25.4.0.2\build\MonoAndroid70\Xamarin.Android.Support.Compat.targets.
I think we should not install this package manually. Xamarin.Forms should take care of the dependencies. All dependencies is in 23.3.0 version and it is clear that no need to install Xamarin.Android.Support.Compat.25.4.0.2 manually.
So what should I do to solve this issue?
Xamarin.Forms locks in a very specific version of the support libraries and google play services. You can't update them because Xamarin.Forms isn't compatible with them as it would need to be re-compiled.
Xamarin.Android.Support.v4 (= 23.0.1.3)
Xamarin.Android.Support.Design (= 23.0.1.3)
Xamarin.Android.Support.v7.AppCompat (= 23.0.1.3)
Xamarin.Android.Support.v7.CardView (= 23.0.1.3)
Xamarin.Android.Support.v7.MediaRouter (= 23.0.1.3)
See the = 23.0.1.3, which means it is only compatible with that version number. This is just how NuGet works. When Xamarin.Forms updates these packages will auto update.
When you want to update Xamarin.Forms ONLY update Xamarin.Forms, don't update all of the packages. When you update just Xamarin.Forms it will update it's dependencies to the correct version number needed.
If you already update the other nugets that aren't letting you update, you could simply uninstall your packages and re-install just Xamarin.Forms.
Here is a video: http://screencast.com/t/U5FBj6KlH
The issue was solved. The package CarouselView.FormsPlugin new version (4.4.3) has dependency to Xamarin.Android.Support.v4 version 24.2.1 (Android 7).
Downgrade to version 4.4.2 fixed the issue.

issues for NuGet after migrating a c# project

i'm trying to migrate a project into my visual studio 2012.
On the Manage NuGet Packages, I have this issue:
"Some NuGet Packages are missing from this solution. Click to restore from your online package sources"... but when i click on the restore button, it appears this issue:
"an error occurred while trying to restore packages: Unable to find version '4.1.0-alpha-121112' of package 'Microsoft.AspNet.WebApi'. "
i'm using .NET Framework 4
How can i solve?
Thanks in advance....
The problem is that version '4.1.0-alpha-121112' of package Microsoft.AspNet.WebApi does not exist on NuGet.org. It is not available on MyGet from the ASP.NET Web Stack Nightly package source either. So NuGet cannot restore it since it is no longer available.
Looking at Symbol Source it looks like this NuGet package was at one point available from the ASP.NET Web Stack Nightly package source on MyGet but it no longer seems to be available. I suspect they have deleted the old packages from that MyGet package source.
Unless you can find the original NuGet package, you will either have to manually remove the NuGet package reference, by editing the project file and packages.config file, and reinstall a version that exists.
1) Make sure you upgrade to the latest NuGet.
2) Make sure you're doing package restore "The Right Way" http://blog.davidebbo.com/2014/01/the-right-way-to-restore-nuget-packages.html
That should resolve the issue.
if still this ain't solve you can see this Rightway to migrate

Resources