macos 在 Mac 上找不到 Android aapt

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11330165/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 09:18:54  来源:igfitidea点击:

Android aapt can not be found on Mac

androidmacosintellij-idea

提问by Blue42

I am getting the following error when trying to compile my android project in IntelliJ (v11.1) on MacOSX.

尝试在 MacOSX 上的 IntelliJ (v11.1) 中编译我的 android 项目时出现以下错误。



I/O error: Cannot run program "/%PATH_TO_SDK%/android-sdk-macosx/platforms
/android-16/tools/aapt": error=2, No such file or directory



有些地方说,当我需要 32 位时,我可能会使用 64 位版本的库,但遇到该问题的每个人都在使用 Ubuntu,因此我找到的解决方案仅适用于此。

The weird thing is, it worked this morning when I only had android-16 installed, but after I downloaded the other versions it stopped.

奇怪的是,今天早上我只安装了 android-16 时它可以工作,但在我下载其他版本后它停止了。

Any help would be appreciated. Can provide more info if needed.

任何帮助,将不胜感激。如果需要,可以提供更多信息。

回答by Jeevan

aapt location has been changed and it can be found at

aapt 位置已更改,可以在以下位置找到

/path/to/adt/sdk/buid-tools/android-[version]/aapt

credits to rafalmanka

归功于rafalmanka

more info: aapt not found under the right path

更多信息:在正确的路径下找不到 aapt

回答by ??? ???? ????

On MacOS with default Android installation, the current aaptlocation is inside specific build-tools version. For build-tools 28.0.3, you will find it in the following path:

在默认安装 Android 的 MacOS 上,当前aapt位置在特定的构建工具版本中。对于 build-tools 28.0.3,您将在以下路径中找到它:

/Users/userName/Library/Android/sdk/build-tools/28.0.3

Remember to change userNameto your username in MacOS.

请记住userName在 MacOS 中更改为您的用户名。