7

The project was working fine before just I reinstalled the OS and Visual Studio, when I build the project this error is showing.

"Failed to resolve 'System.Net.Http.HttpClientHandler' from 'Mono.Android'. Please check your AndroidHttpClientHandlerType setting. TakolA.Mobile.Android"

enter image description here

2
  • did you check the Http Client handler setting in the Android project? Commented Mar 2, 2023 at 14:26
  • Are you facing this issue only since VS 17.5.1 ? Cause we are having the exact same prob since we updated to latest VS Commented Mar 3, 2023 at 15:15

5 Answers 5

10

You can try the following steps:

1.delete the obj folders and bin folders of every platform, then rebuild it.

2.if the problem persists, try to update your Xamarin projects with the Android HttpClient and Native TLS 1.2 settings, then re-build your apps and try again.

The Xamarin.Android HttpClient configuration is in Project Options > Android Options, then click the Advanced Options button.

For more information,check: HttpClient Stack and SSL/TLS Implementation Selector for Android.

Sign up to request clarification or add additional context in comments.

1 Comment

To complement your answer: for Visual Studio Mac version 2022 I changed to AndroidClientHandler via Android Project Properties > Build > Code Generation and Runtime > HttpClient implementation. It worked!
5

Android project Properties > Android Options > Advanced button > HttpClient implementation dropdown - change to Default.

Comments

0

I had the same problem when updating to version VS 17.5.2, I did the procedure in Anton's answer, cleaned the solution and recompiled it, after that the project run normally

Comments

0

I had same error in Pipeline, but locally it was building ok. Switching to Release mode and switching Properties > Android Options > Advanced button > HttpClient implementation dropdown: Managed -> Android solved my issue

Comments

0

I ran into this issue during .net style project migration. I just completely remove AndroidHttpClientHandlerType from csproj file all together and I guess that lets the default take over. Then I had to delete bin and obj in all projects and the error went away

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.