Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xamarin crash: System.MissingMethodException: Method not found: void .ResourceLoadingQuery.set_Instance(object)

When I try to run my Xamarin app, I get this error in InitializeComponent of App.xaml.cs:

System.MissingMethodException: Method not found: void .ResourceLoadingQuery.set_Instance(object)

I tried cleaning and rebuilding my solution, deleting my obj and bin folders, and restarting Visual Studio as advised here but that didn't seem to help...

edit: I also have a bunch of alleged compile errors in Resource.designer.cs which don't prevent the app from running, but maybe they are causing this problem?

enter image description here

like image 591
ekolis Avatar asked Jul 09 '19 16:07

ekolis


1 Answers

I had the same problem and the solution was to update the NuGet packages in all projects and I had updated only in the main project.

I was building only for android so I also needed to update the NuGet in the android project.

enter image description here

But after that I was getting another error message:

error XF005: The $(TargetFrameworkVersion) for TripLog2.Android (v9.0) is less than the minimum required $(TargetFrameworkVersion) for Xamarin.Forms (10.0). You need to increase the $(TargetFrameworkVersion) for TripLog2.Android.

That was fixed by going into properties of android project and select verion 10 (from previously 9).

enter image description here

I tried selection 11 but that didn't work either and created another set of errors.

Note: I had to quit Visual Studio 2019 and start it again. Changing the version may requires updates and they don't take effect properly if VS is not restarted.

like image 53
zar Avatar answered Nov 04 '22 10:11

zar