Visual Studio for Mac looking for Android SDK in wrong place

Joe Manke 1,091 Reputation points
2021-03-16T22:11:06.007+00:00

I just updated VS for Mac from 8.7.9 to 8.9.1, and now I am unable to compile Android projects. (To be honest, I don't know if the upgrade is relevant at all. I typically use Windows for development and only touch VS for Mac to do iOS when the remote connection is being problematic.)

In Visual Studio Preferences, the Android SDK is set to the default, /Library/Developer/Xamarin/android-sdk-macosx. However, when I try to compile an Android project, I get this error message:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Tooling.targets(5,5): Error XARSD7023: System.IO.DirectoryNotFoundException: Could not find a part of the path '/Users/mankej2/Library/Android/sdk'.

If I copy my Android SDK to that location (even without changing the SDK location in Preferences) the build succeeds. But how do I make the build actually target the correct SDK location?

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,369 questions
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
40,936 questions
0 comments No comments
{count} votes

Accepted answer
  1. Joe Manke 1,091 Reputation points
    2021-03-16T22:19:56.99+00:00

    Maybe I should have tried searching with the error code before posting...

    https://stackoverflow.com/questions/66564661/xamarin-forms-would-not-compile-android-project

    TL;DR Known bug in 8.9.1, workaround is to just create the directory /Library/Android/sdk (can be empty, just has to exist), should be fixed in 8.10.

    0 comments No comments

0 additional answers

Sort by: Most helpful

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.