问题描述
我在使用 Android Studio 时遇到了问题.我正在尝试在 Windows 上使用它,但在项目的构建过程中遇到了问题.
I've an issue with Android Studio. I'm trying to use it on Windows but I've trouble during the project's build process.
首先,请注意 Android Studio 安装在我的辅助硬盘上.
First, notice Android Studio is installed on my secondary HDD.
当我尝试构建/运行我的项目时,出现此错误:
When I try to build/run my project I get this error:
Specified AAPT2 executable does not exist:
C:\Users\Rémi\\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-4818971-windows.jar\35960bdffa2420a45dff6ec260c07fa9\aapt2-3.2.0-4818971-windows\aapt2.exe
这里确实没有aapt2.exe
.
但我在这里找到了这个 .exe:
But I've found this .exe here:
H:\Logiciels\AndroidStudioSDK\build-tools\28.0.2\aapt2.exe
和以前的版本在这里:
H:\Logiciels\AndroidStudioSDK\build-tools\27.0.3\aapt2.exe
我尝试通过设置文件>项目结构>模块>应用>构建工具版本来更改构建工具版本来解决此问题.这个选项是空的,我选择了 28.0.2 但这并没有改变任何东西.
I've tried to fix this issue by changing the build tools version by setting File > Project structure > Modules > App > Build Tools Version. This option was empty and I chose 28.0.2 but that doesn't change anything.
感谢阅读.
PS:这个问题 不一样.我的错误有所不同,我的 Grable 文件中有 google()
.
P.S.: This question is not the same. My error is different and I have google()
in my Grable file.
推荐答案
我通过删除预期 aapt2 可执行文件所在的目录来解决它,例如C:\Users\support\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\4c1f5b7dca1d5d378360be7f3fd9726a\aapt2-3.297-1-48然后在 Android Studio
Build
>Clean Project
中进行了清理.
I solved it by deleting the directory under which it expected the aapt2 executable, e.g. C:\Users\support\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\4c1f5b7dca1d5d378360be7f3fd9726a\aapt2-3.2.1-4818971-windows
and then did a clean in Android Studio Build
>Clean Project
.
之后它似乎又下载了这个,缺少可执行文件,现在运行完美.
Afterwards it appears to have downloaded this again, with the missing executable, and now works perfectly.
这篇关于如何解决指定的 AAPT2 可执行文件在 Android Studio 3.2 上不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!