0

Hi I have updated android studio to 3.2.1 recently, It is working fine with existing projects(java). Issue is when I am trying to create an new project (checking Include kotlin Support) then it is showing the following error

build failed:

Specified AAPT2 executable does not exist: C:\Users\umabhavania\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\e602e2dea30bbf2cabd801a8d81b8cdd\aapt2-3.2.1-4818971-windows\aapt2.exe

I have searched for this and also tried following

deleting the directory under which it expected the aapt2 executable As mentioned in this answer

but found no difference, Please help me.

Uma Achanta
  • 3,669
  • 4
  • 22
  • 49
  • have you applied `apply plugin: 'kotlin-kapt'` in your app build.gradle. – karan Nov 15 '18 at 06:27
  • 1
    using kotlin or not has no effect on the aapt2 executable. What's possible is that your cache got corrupted or for some reason your antivirus is blocking aapt2. Delete the whole C:\Users\umabhavania\.gradle directory and see if that helps – Izabela Orlowska Nov 15 '18 at 17:43
  • thanks Izabela Orlowska, Solved this issue with below answer. – Uma Achanta Nov 19 '18 at 06:35

1 Answers1

0

Following solved my issue under jar folder there are 3 folders, one of the folder consists of the aapt2.exe in it. I copied that file to other folder where I am getting error.

ex: path of jar: C:\Users\umabhavania\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar

error path:

C:\Users\umabhavania\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\a57a698502c21bfe8cfc3ed6eb102b39\aapt2-3.2.1-4818971-windows

copied aapt2.exe file from 57f15fb82085ec9389484ff7e041344f folder to a57a698502c21bfe8cfc3ed6eb102b39

Hope this helps..

Uma Achanta
  • 3,669
  • 4
  • 22
  • 49