0

I've just installed Android Studio and I've spent a good couple of days trying to set it up but I got errors here and there.

My current error is:

Error: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error

It looked through similar questions on SO, but I couldn't find a helpful solution.

I have Android Studio Version 3.1.3

I have the following in my build.grade file, but the problem still exists.

compileSdkVersion 27

buildToolsVersion '27.0.3'

enter image description here

I can solve this issue by adding the following line into gradle.properties file with a warning The option 'android.enableAapt2' is deprecated and should not be used anymore:

android.enableAapt2=false

But I get another error instead:

No resource identifier found for attribute 'appComponentFactory' in package 'android'
user9895243
  • 49
  • 1
  • 7

1 Answers1

2
  1. Go to https://developer.android.com/studio/releases/platform-tools
  2. Click on SDK Platform-Tools for Windows for downloading
  3. Unzip the archive and add it to your /Android/platform-tools directory
  4. Restart Android Studio

Also, you can try to change Android Emulator to a different from the default one.

dgr379
  • 353
  • 3
  • 13
  • @dgr279 I give up after I unzip the download how do I add it to Android/platform-tools directory – Vector Aug 21 '18 at 18:42
  • @Grendel, go to the folder you've installed your Android Studio into. Mine was `C:\Android\platform-tools`. – dgr379 Sep 09 '18 at 18:16