如何解决指定的AAPT2可执行文件在Android Studio 3.2中不存在 [英] How to solve Specified AAPT2 executable does not exist on Android Studio 3.2

查看:627
本文介绍了如何解决指定的AAPT2可执行文件在Android Studio 3.2中不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在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.2.1-4818971-windows,然后在Android Studio > 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中不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆