Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Hello-World compile error: Intellij cannot find aapt

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: 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.

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

like image 612
jonS90 Avatar asked May 16 '13 13:05

jonS90


People also ask

How do I get Android SDK for IntelliJ?

From the main menu, select File | Project Structure | Project Settings | Project. If the necessary SDK is already defined in IntelliJ IDEA, select it from the SDK list. If the SDK is installed on your computer, but not defined in the IDE, select Add SDK | 'SDK name', and specify the path to the SDK home directory.

Do I need to install IntelliJ if I have Android Studio?

No. Android Studio and the Android plugin for IntelliJ IDEA are built from the same code, and all of the changes in Android Studio are, and will continue to be, available in IntelliJ IDEA releases.

Can I use Android Studio in IntelliJ?

Android Studio Plugin Development Android Studio plugins extend or add functionality to the Android Studio IDE. Plugins can be written in Kotlin or Java, or a mix of both, and are created using IntelliJ IDEA and the IntelliJ Platform.

Can I open Android Studio project in IntelliJ?

Click File > New > Import Project. Select your IntelliJ project directory, and click OK. Your project will open in Android Studio.


2 Answers

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:

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

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

like image 146
Simon Guest Avatar answered Oct 07 '22 05:10

Simon Guest


update your IntelliJ to 12.1.4 by using beta releases as the update channel enter image description here

like image 21
JoachimR Avatar answered Oct 07 '22 03:10

JoachimR