Android Hello-World 编译错误:Intellij 找不到 aapt [英] Android Hello-World compile error: Intellij cannot find aapt

查看:30
本文介绍了Android Hello-World 编译错误:Intellij 找不到 aapt的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Ubuntu 12.04 中使用 IntelliJ 设置 Android 开发环境.我创建了一个 Android 应用程序模块,但是当我尝试构建时,出现以下错误:

I'm trying to get set up with an Android development environment using IntelliJ in Ubuntu 12.04. I create an Android Application Module, but when I try to build, I get the following error:

android-apt-compiler: 无法运行程序 "/home/jon/Programs/android-sdk-linux/platform-tools/aapt": java.io.IOException: error=2, No such file or directory

android-apt-compiler: Cannot run program "/home/jon/Programs/android-sdk-linux/platform-tools/aapt": java.io.IOException: error=2, No such file or directory

在互联网上搜索了几个小时都没有帮助.

Several hours of scouring the internet hasn't helped.

顺便在终端运行locate aapt,发现aapt位于/home/jon/Programs/android-sdk-linux/build-tools/17.0.0/aapt

By the way, I ran locate aapt in the terminal and found that aapt is located at /home/jon/Programs/android-sdk-linux/build-tools/17.0.0/aapt

推荐答案

似乎 r22 SDK 版本的最新更新将 aapt 和 lib jar 从 platform-tools 移动到 build-tools 目录.在我们等待 JetBrains 发布更新时,这里有一个使用几个符号链接的快速修复:

It appears that the latest update to the r22 SDK release moved aapt and the lib jar from the platform-tools to the build-tools directory. While we wait for JetBrains to release an update, here's a quick fix using a couple of symbolic links:

从您的 AndroidSDK/platform-tools 目录,运行以下命令:

From your AndroidSDK/platform-tools directory, run the following:

ln -s ../build-tools/17.0.0/aapt aapt
ln -s ../build-tools/17.0.0/lib lib

...并且 IntelliJ 应该能够正常编译.

...and IntelliJ should be able to compile as normal.

这篇关于Android Hello-World 编译错误:Intellij 找不到 aapt的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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