Nuget error install package Microsoft.NETCore.UniversalWindowsPlatform - visual-studio

I have a problem with the update Microsoft.NETCore.UniversalWindowsPlatform.
There was version 5.0.0, when you start the development environment, the management offered me a package to update components. All components are successfully updated, except that package. I just receive the message: "Failed to recovery package. Package rollback changes to ***." What to do with this problem, I do not know. Inet clambered, tried to remove the package and put again (by removing the package is not compromised with the same error).

For this error like the following screen shot, two suggestions:
(1)Tools > Options > Projects and Solutions > General, please checked "Save new projects when created" option.
(2)Install the latest packages:
Install-Package Microsoft.NETCore.UniversalWindowsPlatform
https://www.nuget.org/packages/Microsoft.NETCore.UniversalWindowsPlatform/5.2.2

Related

Xamarin.Firebase.Firestore Causes my Xamarin Forms Android Project to Fail Deployment (Xamarin)

I am using Google Firestore in my Xamarin forms app and after updating the Xamarin.Firebase.Firestore Nuget Package to the latest version, I am no longer able to debug my project on Android.
I made a new Xamarin Forms Project to first to check if the error was because of my code or because of an issue with the Nuget Package itself.
I then installed the Xamarin.Firebase.Firestore Nuget Package and quickly found that the problem wasn't with my code, it was with the Nuget Package.
If you are trying to install the Xamarin.Firebase.Firestore Nuget Package and you dont have the Xamarin.AndroidX.Core and Xamarin.AndroidX.Browser Nuget Packages installed, it will say "Could not add Xamarin.Firebase.Firestore" and show a really long error message. This is very annoying because it gives you a novel to read through instead of simply showing a prompt to install the Nuget Packages as dependencies alongside the parent Nuget Package.
Then in order to install the Xamarin.AndroidX.Browser Nuget Package, you first need to install the Xamarin.AndroidX.Core Nuget Package. If you don't install the Xamarin.AndroidX.Core Nuget Package first you will get another long error message saying that you need to install it.
After I install all three Nuget Packages and try to run my Android Project, I get this error message:
/Users/{UserName}/Desktop/FirebaseTests/FirebaseTests/FirebaseTests.Android: Error JAVA0000: Error in /Users/{UserName}/.nuget/packages/xamarin.google.guava/31.1.0.3/buildTransitive/monoandroid12.0/../../jar/guava.jar:com/google/common/annotations/Beta.class:
Type com.google.common.annotations.Beta is defined multiple times: /Users/{UserName}/.nuget/packages/xamarin.google.guava/31.1.0.3/buildTransitive/monoandroid12.0/../../jar/guava.jar:com/google/common/annotations/Beta.class, obj/Debug/lp/102/jl/__reference__guava.jar:com/google/common/annotations/Beta.class
Compilation failed
java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: /Users/{UserName}/.nuget/packages/xamarin.google.guava/31.1.0.3/buildTransitive/monoandroid12.0/../../jar/guava.jar
com/google/common/annotations/Beta.class
at com.android.tools.r8.internal.Bj.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:98)
at com.android.tools.r8.D8.main(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:4)
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: /Users/{UserName}/.nuget/packages/xamarin.google.guava/31.1.0.3/buildTransitive/monoandroid12.0/../../jar/guava.jar:com/google/common/annotations/Beta.class
at Version.fakeStackEntry(Version_3.3.28.java:0)
at com.android.tools.r8.internal.Bj.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:75)
at com.android.tools.r8.internal.Bj.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:28)
at com.android.tools.r8.internal.Bj.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:27)
at com.android.tools.r8.internal.Bj.b(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:2)
at com.android.tools.r8.D8.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:22)
at com.android.tools.r8.D8.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:17)
at com.android.tools.r8.internal.Bj.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:85)
... 1 more
Caused by: com.android.tools.r8.internal.f: Type com.google.common.annotations.Beta is defined multiple times: /Users/{UserName}/.nuget/packages/xamarin.google.guava/31.1.0.3/buildTransitive/monoandroid12.0/../../jar/guava.jar:com/google/common/annotations/Beta.class, obj/Debug/lp/102/jl/__reference__guava.jar:com/google/common/annotations/Beta.class
at com.android.tools.r8.internal.DT.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:14)
at com.android.tools.r8.internal.DT.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:22)
at com.android.tools.r8.internal.CN.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:33)
at com.android.tools.r8.internal.CN.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:10)
at java.base/java.util.concurrent.ConcurrentHashMap.merge(ConcurrentHashMap.java:2048)
at com.android.tools.r8.internal.CN.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:6)
at com.android.tools.r8.graph.B2$a.e(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:4)
at com.android.tools.r8.dex.b.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:105)
at com.android.tools.r8.dex.b.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:28)
at com.android.tools.r8.D8.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:25)
at com.android.tools.r8.D8.d(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:606)
at com.android.tools.r8.D8.c(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:1)
at com.android.tools.r8.internal.Bj.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:24)
... 5 more
Directory 'obj/Debug/lp/102' is from 'Xamarin.Grpc.Stub.dll'. (JAVA0000) (FirebaseTests.Android) java
The error refers to Xamarin.Google.Guava so I thought installing Xamarin.Google.Guava individually would solve the issue but not at all; I am still getting the same error.
Could someone please help me? There is no way I am the only person this is happening to.
You should file the bug, Xamarin.Firebase.Firestore needs to work when installed: https://github.com/xamarin/GooglePlayServicesComponents/issues/new
Aside from that you may try some older version and see if it works, e.g. version 123.0.3.7 seems to work well for me.

Failed to download package - NuGet Packages - Xamarin forms

I've got this error in my Xamarin Forms project for all the packages installed in it:
Failed to download package 'Fody.6.5.1' from 'https://api.nuget.org/v3-flatcontainer/fody/6.5.1/fody.6.5.1.nupkg'.
The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/fody/6.5.1/fody.6.5.1.nupkg' has timed out after 100000ms.
I've cleaned the solution & restoring NuGet Package but I still have the same errors.
You can try to install older versions.May be related to the project.
You can manage to restart VS to get the package to reinstall.And just to confirm, make sure your internet connection active and stable at the time.Also,you can try to install other versions of Fody as Furkan mentioned.

nuget package , can't install EntityFrameworkCore.sqlserver

Hi I can't install microsoft.entitiyFrameWorkCore.sqlserver via NuGet package in
VS 2019. I am getting this error The feed 'nuget.org
[https://api.nuget.org/v3/index.json]' lists package
'Microsoft.Data.SqlClient.2.0.1' but multiple attempts to download the
nupkg have failed. The feed is either invalid or required packages
were removed while the current operation was in progress. Verify the
package exists on the feed and try again. Unable to find package
'Microsoft.Data.SqlClient.2.0.1'.
PS : my VS version isn't the latest one
It looks it was becaues the very bad internet connection I have , since when I connected to 4g it installed successfully

Why am I getting Warning NU1605, which appeared out of the clear blue

I had a working app when suddenly I got this warning:
"Warning NU1605 Detected package downgrade: Microsoft.NETCore.UniversalWindowsPlatform from 6.2.9 to 6.1.9."
In trying to figure out what is going on, I found that a new project with no added code will get this error too.
I also found that I could open the .csproj file in Notepad and change the line from 6.1.9 to 6.2.9 but wonder why I have to do this or what else I should be doing.
"Warning NU1605 Detected package downgrade: Microsoft.NETCore.UniversalWindowsPlatform from 6.2.9 to 6.1.9."
From shared warnning log, you need to update Nuget Package (Microsoft.NETCore.UniversalWindowsPlatform) form 6.1.9 to 6.2.9.
About updating can follow bellow steps:
Click Tools-> Nuget Package Manager -> Manange Nuget Packages for Solution...
Then in Installed will see the nuget package there:
Select the neeed version to install:

Package Restore drops pending zero, installing package does not

We have an internal NuGet feed, one of the packages is EPPlus.3.1.3.0.nupkg. Inside the package, EPPlus.nuspec file contains <version>3.1.3.0</version> and the file under package\services\metadata\core-properties\contains <version>3.1.3.0</version>.
In the package browser, it's listed as Version: 3.1.3.0. When installing this package, it is placed under packages\EPPlus.3.1.3.0. The .csproj file contains <HintPath>..\packages\EPPlus.3.1.3.0\lib\net20\EPPlus.dll</HintPath>.
When restoring the package, it's instead restored under packages\EPPlus.3.1.3. This causes the build to fail. Removing and reinstalling the package makes the build work again.
What's causing this issue?
The official NuGet repository also hosts this package, but it uses version 3.1.3 instead of 3.1.3.0
Package restore checks all your feeds in a certain order, which can be set under Options -> NuGet Package Manager -> Package Sources by clicking arrow buttons. If the official repository is listed above your internal feed, it will instead try to restore the package from there.
So while theoretically both packages should hold the same version, the project will indeed fail to build. I've raised a bug report here.

Resources