Building failed after updating Android Studio to 3.0. Error: Unexpected optical borders detected (red pixel)

I upgraded my Android Studio to 3.0 on Ubuntu. When I downloaded the project, it could not build, and the same project had no problems when it was created in the previous version (version 2.3) of Android Studio. And the error says:

Error: unexpected optical boundaries (red pixel) were detected at the upper boundary at x = 14.

Error:.

Error: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error

+5
source share
2 answers
Finally, I figured out this problem. This was due to some 9 patch icons that I used in my project resources. I used some third-party tools to draw these icons. Now I have replaced these icons with the same one created using Android studio ( see how ), and everything works for me.

Also, if you do not want to use AAPT2. You can disable the android.enableAapt2=false setting in your gradle.properties file as suggested by @ capt.swag

+3
source

After upgrading to Android Studio 3.0, I ran into the same problem. I solved the problem by setting android: enableAapt2 = false

Incremental resource processing using AAPT2 is improved, which is enabled by default. If you are having problems using AAPT2, you can disable it by setting the file android.enableAapt2 = false in the gradle.properties file and restarting the Gradle daemon by running. / gradlew --stop from the command line.

More on this in here.

+9
source

Source: https://habr.com/ru/post/1272902/


All Articles