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

2

5

I have a Mobile App built with Xamarin.Forms

After I Updated Visual Studio from 16.4.4 to 16.7.0

These errors appeared

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       

What I have tried?

1- I tried to delete bin and obj folders to force the project to rebuild everything, but the errors still appear

2- I tried to downgrade to 16.4.4 and the errors are gone, but I don't want to fix it by this way because I want to create a new other application using this new feature in 16.7.0

So, Is there a way to get rid of these errors without downgrade to the old version?

Notes:

The version of Xamarin.Forms is 2.3

Hinz answered 10/8, 2020 at 17:36 Comment(18)
Please set the TargetFramework to the latest to make a test like this setting screenshot imgur.com/a/6qklMqNLengthways
@LeonLu-MSFT thanks for your comment, I tried this now but unfortunately, the errors still appearHinz
@LeonLu-MSFT the version of xamarin.forms I use is 2.3Hinz
Please update your xamarin forms version to the latest.Lengthways
xamarin forms 2.3 is too old. If you use other nuget packages, plesae update all of themLengthways
unfortunately, I can't update to the latest version because I use old libraries based on version 2.3. So, if I update XF to 4.8 I will not be able to use these libraries and i should change itHinz
Let us continue this discussion in chat.Hinz
Could you please provide a sample?Unconditioned
@Unconditioned apologize, this app is for my company and I cannot share it hereHinz
I open the error's link.I found this thread learn.microsoft.com/en-us/dotnet/core/project-sdk/…Lengthways
Whats the exact version of 2.3? i had the same issue i have fixed itBeekeeper
@Blu Xamarin.Forms v2.3Hinz
@LeonLu-MSFT Thanks for the mention I will try this and tell you the resultHinz
@AnasAlweish try upgrading XF version to v2.5.0.28055, as it won't break any of your custom controls or renderers if you go ahead than this, few internal API calls get restricted & won't work. v2.5.0.28055 this is the version working for me. (*my error was - the project couldn't build, it always fails then after few changes it worked but I got error of target invocation & application use to get crash )Beekeeper
Same as you, I cant further upgrade my XF version as it breaks some of our custom controls. I literally wasted 3-4 weeks to find it out & run my project successfully without breaking anything.Beekeeper
Thanks for your comment again (this error)[learn.microsoft.com/en-us/dotnet/core/project-sdk/… appeared after I upgraded to v2.5.0.28055 and after I tried the solution provided in the above document I get other errors such as CustomRenderer not found ... are you missing ... and also fixed and then when I rebuild the project I get other errors ...Hinz
So, because I have another PC, I think it's better for me to save the time and run this project on the old version to support the app until the company decide to upgrade to the latest version of Xamarin.FormsHinz
For others, if you faced the same issue and you don't have in your project other libraries based on the old version of XF, it's better for you to upgrade to the latest version as @Brandon Minnick recommended hereHinz
C
5

The version of Xamarin.Forms is 2.3

You'll need to update a newer version of Xamarin.Forms because Visual Studio 2019 won't support v2.3; Xamarin.Forms v2.3 was released in 2016.

I recommend using the latest version of Xamarin.Forms.

Coyote answered 14/8, 2020 at 17:8 Comment(3)
Thank you very much for your answer, I know your answer is the correct, but when I upgraded the project from vs2017 to vs2019 these errors have not appeared, and now If I downgrade to the old version 16.4.4 I can build the project. So, do you mean XF v2.3 won't be supported from version VS 16.7 and higher?Hinz
Also, I can't update to the latest version because I use old libraries based on version 2.3, and for that reason, I try to find another solution because the app is installed on customer devices also my company don't' want to upgrade nowHinz
Thank you, Brandon, for the correct answer but for me, I can't update now, So, I opened the project on another device using vs2019 16.4.4 and it's working fineHinz
W
3

android version 10 don't support Xamarin.Android.Support.v7 if you change your target framework version to Android version 9 your able to debug in device.

follow the step

go to Android.project > properties > target framework

enter image description here

enter image description here

Wanwand answered 16/8, 2020 at 12:21 Comment(2)
Thanks for your answer, Yes I tried this now and it's not workingHinz
Your solution saved my day. Got the error after the installation of Xamarin.Auth. Downgrade to 10 solved the issue. Many thanks.Nirvana

© 2022 - 2024 — McMap. All rights reserved.