本文介绍了在x = 14的顶部边框上发现了意外的光学范围(红色像素)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,我将更新到Android Studio 3.3和Gradle 3.3,在此版本中,gradle.property 'android.enableAapt2=false'无效,因为现在始终使用AAPT2.真正的问题出在我删除此行时,因为无法编译,因此抛出的下一个错误是:

Recently, I'm updating to Android Studio 3.3 and Gradle 3.3, in this version the gradle.property 'android.enableAapt2=false' has no effect because AAPT2 is now always used. The real problem comes when I delete this line, because can't compile, the next error that throws is:

错误:在x = 14的顶部边框上发现了意外的光学边界(红色像素).

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

在以前的版本中,我们可以按照此帖子来解决此问题.现在,我无法编译我的应用程序,因为存在此错误.

In the previous versions we can solve this problem as in this post. Now I can't compile my app cause exists this error.

更新从:2019-01-24

Update from: 2019-01-24

最后,我在Android Studio 3.2中发现了新日志错误的真正问题:

Finally I found the real problem with the new log error in Android Studio 3.2:

命令:/Users/myProject/.gradle/caches/transforms-1/files-1.1/aapt2- 3.2.1-4818971-osx.jar/0a24b213ff9fab058ea2520938e2e6e3/aapt2-3.2.1-> 4818971-osx/aapt2 compile --legacy \ -o \ /Users/myProject/android-> app/myProject/app/build/intermediates/res/merged/debug \ /Users/myProject/android-app/myProject/app/src/main/res/drawable-> hdpi/balloon_incoming_normal.9.png

Command: /Users/myProject/.gradle/caches/transforms-1/files-1.1/aapt2- 3.2.1-4818971-osx.jar/0a24b213ff9fab058ea2520938e2e6e3/aapt2-3.2.1->4818971-osx/aapt2 compile --legacy \ -o \ /Users/myProject/android->app/myProject/app/build/intermediates/res/merged/debug \ /Users/myProject/android-app/myProject/app/src/main/res/drawable->hdpi/balloon_incoming_normal.9.png

守护程序:AAPT2 aapt2-3.2.1-4818971-osx守护程序#1

Daemon: AAPT2 aapt2-3.2.1-4818971-osx Daemon #1

文件产生此问题是:

要下载的网址

有什么主意吗?预先感谢!

Any idea? Thanks in advance!

推荐答案

我已按照以下步骤解决了此问题:

I solved this issue following this steps:

  1. 复制资源,复制文件.
  2. 将文件重命名为原始名称

示例: Balloon_outgoing_normal.9-copy.png Balloon_outgoing_normal.png

Example: balloon_outgoing_normal.9 - copy.png to balloon_outgoing_normal.png

  1. 删除9个修补程序无效的文件.

示例:: Balloon_outgoing_normal.9.png

Example:: balloon_outgoing_normal.9.png

  1. 在Android Studio中打开文件
  2. 右键单击每个文件(mdpi,hdpi等.)
  3. 选择创建9个补丁文件... ,然后将每个文件保存在您各自的文件夹(mdpi,hdpi等)中.
  1. Open the file in Android Studio
  2. Right-click on each file (mdpi, hdpi, etc..)
  3. Select Create-9-Patch File... and save each file on your respective folder (mdpi, hdpi, etc..)

完成此步骤后,我在编译上取得了成功.

After this steps, I had success on compilation.

这篇关于在x = 14的顶部边框上发现了意外的光学范围(红色像素)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-12 18:29