如何修复更新到 Visual studio 2019 版本 16.7.0 后出现的错误

How to fix errors that appear after Updating to Visual studio 2019 version 16.7.0

我有一个使用 Xamarin.Forms

构建的移动应用程序

我将 Visual Studio 从 16.4.4 更新到 16.7.0

之后

出现了这些错误

Assembly 'Xamarin.GooglePlayServices.Maps' is using '[assembly: Java.Interop.JavaLibraryReferenceAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author. MyApp.Android           
Assembly 'Xamarin.Android.Support.v7.CardView' is using '[assembly: Android.IncludeAndroidResourcesFromAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author.   MyApp.Android           
Assembly 'Xamarin.GooglePlayServices.Base' is using '[assembly: Android.IncludeAndroidResourcesFromAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author.   MyApp.Android           
Assembly 'Xamarin.Android.Support.v7.MediaRouter' is using '[assembly: Java.Interop.JavaLibraryReferenceAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author.  MyApp.Android           
Assembly 'Xamarin.Android.Support.Vector.Drawable' is using '[assembly: Java.Interop.JavaLibraryReferenceAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author. MyApp.Android           
Assembly 'Xamarin.Android.Support.Design' is using '[assembly: Android.IncludeAndroidResourcesFromAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author.    MyApp.Android           
Assembly 'Xamarin.GooglePlayServices.Gcm' is using '[assembly: Java.Interop.JavaLibraryReferenceAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author.  MyApp.Android           
Assembly 'Xamarin.Android.Support.v7.AppCompat' is using '[assembly: Java.Interop.JavaLibraryReferenceAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author.    MyApp.Android           
Assembly 'Xamarin.Android.Support.v7.RecyclerView' is using '[assembly: Java.Interop.JavaLibraryReferenceAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author. MyApp.Android           
Assembly 'Xamarin.GooglePlayServices.Basement' is using '[assembly: Android.IncludeAndroidResourcesFromAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author.   MyApp.Android           
Assembly 'Xamarin.Android.Support.Animated.Vector.Drawable' is using '[assembly: Java.Interop.JavaLibraryReferenceAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author.    MyApp.Android           
Assembly 'Xamarin.Android.Support.v7.AppCompat' is using '[assembly: Android.IncludeAndroidResourcesFromAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author.  MyApp.Android           
Assembly 'Xamarin.GooglePlayServices.Maps' is using '[assembly: Android.IncludeAndroidResourcesFromAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author.   MyApp.Android           
Assembly 'Xamarin.Android.Support.v4' is using '[assembly: Java.Interop.JavaLibraryReferenceAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author.  MyApp.Android           
Assembly 'Xamarin.Android.Support.v7.CardView' is using '[assembly: Java.Interop.JavaLibraryReferenceAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author. MyApp.Android           
Assembly 'Xamarin.Android.Support.v4' is using '[assembly: Java.Interop.JavaLibraryReferenceAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author.  MyApp.Android           
Assembly 'Xamarin.GooglePlayServices.Gcm' is using '[assembly: Android.IncludeAndroidResourcesFromAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author.    MyApp.Android           
Assembly 'Xamarin.Android.Support.v7.RecyclerView' is using '[assembly: Android.IncludeAndroidResourcesFromAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author.   MyApp.Android           
Assembly 'Xamarin.Android.Support.Design' is using '[assembly: Java.Interop.JavaLibraryReferenceAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author.  MyApp.Android           
Assembly 'Xamarin.Android.Support.v7.MediaRouter' is using '[assembly: Java.Interop.JavaLibraryReferenceAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author.  MyApp.Android           
Assembly 'Xamarin.Android.Support.Animated.Vector.Drawable' is using '[assembly: Android.IncludeAndroidResourcesFromAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author.  MyApp.Android           
Assembly 'Xamarin.Android.Support.Vector.Drawable' is using '[assembly: Android.IncludeAndroidResourcesFromAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author.   MyApp.Android           
Assembly 'Xamarin.GooglePlayServices.Base' is using '[assembly: Java.Interop.JavaLibraryReferenceAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author. MyApp.Android           
Assembly 'Xamarin.Android.Support.v7.MediaRouter' is using '[assembly: Android.IncludeAndroidResourcesFromAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author.    MyApp.Android           
Assembly 'Xamarin.Android.Support.v4' is using '[assembly: Android.IncludeAndroidResourcesFromAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author.    MyApp.Android           
Assembly 'Xamarin.GooglePlayServices.Basement' is using '[assembly: Java.Interop.JavaLibraryReferenceAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author. MyApp.Android       

我试过什么?

1- 我试图删除 binobj 文件夹以强制项目重建一切,但错误仍然出现

2- 我尝试降级到 16.4.4 并且 错误消失了 ,但我不想通过这种方式修复它,因为我想使用此 new feature in 16.7.0

创建一个新的其他应用程序

那么,有没有办法在不降级到旧版本的情况下消除这些错误?

备注:

Xamarin.Forms的版本是2.3

The version of Xamarin.Forms is 2.3

您需要更新 Xamarin.Forms 的更新版本,因为 Visual Studio 2019 将不支持 v2.3; Xamarin.Forms v2.3 是 released in 2016

我推荐使用最新版本Xamarin.Forms。

android 版本 10 不支持 Xamarin.Android.Support.v7 如果将目标框架版本更改为 Android 版本 9,则可以在设备中进行调试。

按照步骤

转到Android.project > properties > target framework