Cannot find 'aapt.exe' - latest version of Visual Studio 2019 and Xamarin installed

Jouni Juntunen 141 Reputation points
2021-01-06T12:34:04.043+00:00

Hello,

I have the latest version of Visual Studio 2019 community edition installed. A couple of days ago I installed Xamarin and Android SDK by following the instructions given in this course material "Xamarin Tutorial - Hello World in 10 minutes" available from this URL:
https://dotnet.microsoft.com/learn/xamarin/hello-world-tutorial/intro

When I try to build the downloaded VS solution I see this error message:
"Cannot find 'aapt.exe'. Please install the Android SDK Build-Tools package with the C:\Program Files (x86)\Android\android-sdk\tools\android.bat program. MobileAppTest.Android"

Sure enough, there's no aapt.exe anywhere under C:\Program Files (x86). I also tried running the "android.bat" script as instructed in the message. This led to this message being displayed:


The "android" command is deprecated.
For manual SDK, AVD, and project management, please use Android Studio.
For command-line tools, use tools\bin\sdkmanager.bat
and tools\bin\avdmanager.bat


Invalid or unsupported command ""

Supported commands are:
android list target
android list avd
android list device
android create avd
android move avd
android delete avd
android list sdk
android update sdk

Firstly, it says that this batch script is deprecated. Secondly, I am not sure which option I should specify to installl 'aapt.exe' (if this is at all possible after this batch script has been deprecated).

I could of course install Android Studio as suggested, but I suspect that doing so would not allow me to learn to use Xamarin, which is my aim with this exercise.

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,364 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,012 questions
0 comments No comments
{count} vote

Accepted answer
  1. Jouni Juntunen 141 Reputation points
    2021-01-07T12:18:00.5+00:00

    It appears that the course material I was following was slightly out of date. Unlike any VS2019 native components, there were no notifications for any available component updates. I had to navigate manually to Tools -> Android -> Android SDK Manager, and after doing so there were notifications for certain updates. After I installed those updates, I was able to build and run the Xamarin "Hello World" example. Thanks for your suggestion, Jarvan!

    8 people found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. JarvanZhang 23,961 Reputation points
    2021-01-06T14:50:29.673+00:00

    Hello,​

    Welcome to our Microsoft Q&A platform!

    Cannot find 'aapt.exe'. Please install the Android SDK Build-Tools package with the ...

    Have you installed the Android SDK Build Tools? Go to Tools -> Android -> Android SDK Manager -> Tools to install the function. You could check the following guideline which explain the steps to set up Android SDK for Xamarin.Android more detaily.

    https://learn.microsoft.com/en-us/xamarin/android/get-started/installation/android-sdk?tabs=windows

    Best Regards,

    Jarvan Zhang


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    6 people found this answer 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.