Android Maven Could not find tool 'aapt'

I also encountered the same problem when using latest ADT from google and trying to compile the bootstrap android platform.

The latest r17 build separate out aapt to build-tools folder. Hence it is maven-android-plugin cannot support it.

See issue discussed here.

Tried and working:

cd $ANDROID_HOME/platform-tools
ln -s ../build-tools/android-4.2.2/aapt aapt
ln -s ../build-tools/android-4.2.2/lib lib
ln -s ../build-tools/android-4.2.2/aidl aidl

Some installations may be structured using the API version:

cd $ANDROID_HOME/platform-tools
ln -s ../build-tools/17.0.0/aapt aapt
ln -s ../build-tools/17.0.0/lib lib
ln -s ../build-tools/17.0.0/aidl aidl

Keep in mind that this is fixed in the latest version (>3.5.3) of the Android Maven Plugin, as other answers point out.


If you are using Windows, the symbolic linking can be done using mklink command.

D:\>cd "Program Files (x86)\Android\android-sdk"

D:\Program Files (x86)\Android\android-sdk>cd platform-tools

D:\Program Files (x86)\Android\android-sdk\platform-tools>mklink aapt.exe ..\build-tools\17.0.0\aapt.exe
symbolic link created for aapt.exe <<===>> ..\build-tools\17.0.0\aapt.exe

D:\Program Files (x86)\Android\android-sdk\platform-tools>mklink aidl.exe ..\build-tools\17.0.0\aidl.exe
symbolic link created for aidl.exe <<===>> ..\build-tools\17.0.0\aidl.exe

D:\Program Files (x86)\Android\android-sdk\platform-tools>mklink /d lib ..\build-tools\17.0.0\lib
symbolic link created for lib <<===>> ..\build-tools\17.0.0\lib

Update:

This has been resolved since Android Maven Plugin v3.6.0. For now you will only need these symlinks if you use IntelliJ v12.x. IntelliJ v13 EAP+ should work out of the box.

Original answer:

This has been fixed and will be released with Android Maven Plugin v3.5.4. See the github pull request:

Upgraded AndroidSdk to use path and platform utilities from sdklib

You can try validating the snapshot build which contains the fix by adding the following to your pom.xml:

<plugin>
    <groupId>com.jayway.maven.plugins.android.generation2</groupId>
    <artifactId>android-maven-plugin</artifactId>
    <version>3.5.4-SNAPSHOT</version>
    ...
</plugin>
...
<pluginRepositories>
  <pluginRepository>
    <id>oss.sonatype.org-jayway-snapshots</id>
    <name>Jayway OpenSource SNAPSHOTs on Sonatype.org</name>
    <url>http://oss.sonatype.org/content/repositories/jayway-snapshots/</url>
    <snapshots>
      <enabled>true</enabled>
    </snapshots>
  </pluginRepository>
</pluginRepositories>

Please provide feedback on the developer group:

New snapshot for 3.5.4 available