Search code examples
androidsdkaapt2

AAPT2 missing in Android SDK


I have lost the aapt2 file from android sdk.

can someone please tell me from where I can download the aapt2 file, as I am not able to build my application.

I tried finding an answer but it is not available.


Solution

  • How did you lose it? There are two options with two different solutions:

    • Possible problem: You (or another program) deleted AAPT2 manually.
      • Solution: Delete the whole build-tools/<version with missing aapt2> folder, then use the SDK Manager to re-download the removed build tools.
    • Possible problem: You're using Android Gradle Plugin 3.2.0-alpha11 or newer which uses AAPT2 from maven and you're getting errors saying that AAPT2 was not found.
      • Solution: You need to make sure you have repositories { google() } under both buildscript and allprojects in your main build.gradle file.