10

Recently I encountered this issue after updating my android studio to the latest version 4.0.

Dayo Jaiye
  • 948
  • 1
  • 10
  • 17

6 Answers6

33

I recently solved this problem

Open Android Studio

  1. Click on File > Settings > Appearance & Behaviour > System Settings > Android SDK
  2. Click on SDK Tools
  3. Under that Click on Android SDK Build Tools
  4. Click on Show package Details at the bottom right corner
  5. Now find 29.0.2
  6. Click on that
  7. Click on Apply > (Wait until download completion) > Finish > Ok
Sharath B Naik
  • 1,016
  • 7
  • 14
7
  1. Click Open Project Structure icon or use keyboard shortcut directly (shift+ctrl+alt+s)

Project Structure

  1. Click Modules

Modules

  1. Select the properties option

properties

  1. choose to download and install the various configurations make sure the Build Tools version and the compiled sdk version are consistent

download and install

  1. Re-run the project
benomatis
  • 5,536
  • 7
  • 36
  • 59
ikmazameti
  • 131
  • 3
  • 12
2

So tried all the solutions but got stuck at one point, couldn't locate "C:\Users\Username\AppData\Local\Android\Sdk\build-tools" this path.

The way around this is to close the current project you're working on.. Click "Configure" at the bottom right of Android studio Click 'SDK manager" Click 'SDK tools" Tick 'Show Package Details" look for the corresponding build-tools, in my case, 29.0.2 Click apply

it should download the build tool>>> then rebuild project

1
  1. download last version platform-tools this link https://developer.android.com/studio/releases/platform-tools
  2. copy platform-tools to sdk\platform-tools
  3. rebuild
1

Please note that 'platform-tools' differs from 'build-tools'. Here the topic is 'build-tools' so here's what worked for my case: what you need to do is simply download required
'build-tools' from somewhere like: https://androidsdkmanager.azurewebsites.net/Buildtools then copy the downloaded folder somewhere like(if you use Windows): C:\Users\Username\AppData\Local\Android\Sdk\build-tools, then change the downloaded file name to the version of build tool(for this question the version is 29.0.2). Re-build and re-run your project. Good luck!

Ali Rahgozar
  • 57
  • 1
  • 5
0

Each version of the Android Gradle Plugin now has a default version of the build tools.

So, probably you specified build tool version explicitly in the build file. Just remove buildToolsVersion = "x.y.z" from your build.gradle script.

If, for some reason, you need that specific revision, follow the other answer.

Mahozad
  • 18,032
  • 13
  • 118
  • 133