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'
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'
Also, you can try to change Android Emulator to a different from the default one.