**System.MissingMethodException:** 'Method not found: void

Sakshi Poojary 95 Reputation points
2023-09-14T06:53:34.78+00:00

When I try to run my Xamarin Forms project and click on the login button on the main page, I get the below exception:

System.MissingMethodException: 'Method not found: void AndroidHUD.AndHUD.Show(Android.Content.Context,string,int,AndroidHUD.MaskType,System.Nullable`1<System.TimeSpan>,System.Action,bool,System.Action)'

I tried cleaning and rebuilding my solution, deleting my obj and bin folders, and updating the NuGet packages, but that didn't help.

Below is the login button clicked code where I'm getting the exception:

public async void LoginButtonClicked(Object sender, EventArgs e)
	{
		UserDialogs.Instance.ShowLoading("Signing in...");
		var name = usernameEntry.Text;
		var password = passwordEntry.Text;
		var domain = domainnameEntry.Text;
		if (Utility.IsInternet())
		{
			if (!string.IsNullOrWhiteSpace(name) && !string.IsNullOrWhiteSpace(password) && !string.IsNullOrWhiteSpace(domain))
			{
				Utility.isTokenRefresh = false;
				await Utility.GetAccessToken();
				if (Utility.isTokenRefresh)
				{
					GetSiteId(name, password, domain);
				}
				else
				{
					UserDialogs.Instance.HideLoading();
					ShowAlert("Failed to fetch the access token, please try again later.");
				}
			}
			else
			{
				UserDialogs.Instance.HideLoading();
				if (!Utility.IsWindowsDevice())
				{
					await DisplayAlert("Alert", "Please enter all details.", "Ok");
				}
				else
				{
					ShowAlert("Please enter all details.");
				}
			}
		}
		else
		{
			UserDialogs.Instance.HideLoading();
			if (!Utility.IsWindowsDevice())
			{
				await DisplayAlert("Alert", "No internet connection.", "Ok");
			}
			else
			{
				ShowAlert("No internet connection.");
			}
		}
	}

How can I fix this issue? Please suggest a solution.

Developer technologies .NET Xamarin
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.