user3748973
user3748973

Reputation: 459

Visual studio compilation error, Xamarin.forms

I create Hello world project in Visual Studio 2015 based on Xamarin.forms(portable), but when I try to build, I get the following error:

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. App3.Droid

My android SDK manager: enter image description here

I had older version of sdk platform tools, but Visual Studio give me an error that you have remove older version of sdk tools than 23.0.0

Upvotes: 0

Views: 4807

Answers (3)

Ogglas
Ogglas

Reputation: 70186

In Visual Studio 2019 you can fix this inside Visual Studio.

Simply go to Tools -> Android -> Android SDK Manager and either repair or install the recommended versions.

In my case I had this error:

XA5205 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.

I could then click on this error to let Visual Studio fix it for me:

Xamarin.Android for Visual Studio requires Android SDK. Please click here to configure.

enter image description here

Upvotes: 3

Nikita
Nikita

Reputation: 303

Clean your project and Delete all from the path: C:\Users\USERNAME\AppData\Local\Xamarin Folders and Zip files. And then rebuild your project.

Upvotes: 0

SushiHangover
SushiHangover

Reputation: 74194

Do not remove platform-tools, there are three core Google/Android platform packages needed for building apps:

  • build-tools
  • platform-tools
  • tools

And aapt.exe is located within in build-tools, not platform-tools and it appears you are missing that package installation.

enter image description here

Open up Android SDK Manager and perform a "Packages \ Reload".

enter image description here

If a build-tools package does show up I would reinstall the Android SDK.

Note: Your Android SDK Manager looks really different then the current version, what version is that? (mine is v23)

enter image description here

Upvotes: 2

Related Questions