Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build unsuccessful after updating android studio to 3.0. Error:Found unexpected optical bounds (red pixel)

I updated my Android Studio to 3.0 in Ubuntu. When I loaded a project it fails to build and the same project has no issues when it was built in previous version(v2.3) of Android Studio. And the error says,

Error:found unexpected optical bounds (red pixel) on top border at x=14.

Error:.

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

like image 927
devgun Avatar asked Oct 26 '17 06:10

devgun


2 Answers

After updating to Android Studio 3.0 I was also facing the same issue. I solved the problem by setting android.enableAapt2=false

Improved incremental resource processing using AAPT2, which is enabled by default. If you are experiencing issues while using AAPT2, you can disable it by setting android.enableAapt2=false in your gradle.properties file and restarting the Gradle daemon by running ./gradlew --stop from the command line.

More about it in here

like image 192
capt.swag Avatar answered Oct 27 '22 02:10

capt.swag


Finally I found out the problem. It was due to some 9 patch icons that I used in my project resources. I have made use of some 3rd party tool to draw these icons. Now I replaced those icons with that of the same generated using Android studio(see how) and everything is working for me.

Also if you don't want to use AAPT2. You can disable by setting android.enableAapt2=false in your gradle.properties file as suggested by @capt.swag

like image 20
devgun Avatar answered Oct 27 '22 01:10

devgun