如何解决指定的 AAPT2 可执行文件在 Android Studio 3.2 上不存在

编程入门 行业动态 更新时间:2024-10-11 21:24:35
本文介绍了如何解决指定的 AAPT2 可执行文件在 Android Studio 3.2 上不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我在使用 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 上不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-15 04:31:00,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何解决   上不   可执行文件   Android   Studio

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!