android studio升级到3.0后构建不成功.错误:发现意外的光学边界(红色像素) [英] Build unsuccessful after updating android studio to 3.0. Error:Found unexpected optical bounds (red pixel)
问题描述
我在 Ubuntu 中将我的 Android Studio 更新到了 3.0.当我加载一个项目时,它无法构建,并且同一个项目在 Android Studio 的先前版本 (v2.3) 中构建时没有问题.错误说,
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,
错误:在 x=14 的顶部边框上发现意外的光学边界(红色像素).
Error:found unexpected optical bounds (red pixel) on top border at x=14.
错误:.
错误:java.util.concurrent.ExecutionException:com.android.tools.aapt2.Aapt2Exception:AAPT2 错误
Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error
推荐答案
终于找到问题所在了.这是由于我在我的项目资源中使用了大约 9 个补丁图标.我使用了一些 3rd 方工具来绘制这些图标.现在我将这些图标替换为使用 Android Studio 生成的相同图标(看看如何) 一切都对我有用.
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.
另外,如果您不想使用 AAPT2.您可以按照@capt.swag
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
这篇关于android studio升级到3.0后构建不成功.错误:发现意外的光学边界(红色像素)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!