Fix your Android IDE for SDK 17 and the Android Maven Plugin < 3.5.4

Recently I started working on an Android App and after some initial problems with
the new Android Studio based on IntelliJ I am back on a regular maven build process.
But when setting up my project with the current version of the “old” Android IDE based
on Eclipse
and the Maven Android Plugin I stumbled upon some errors when trying
to build the project:

Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.1.1:generate-sources 
   (default-generate-sources) on project tutorial: Execution default-generate-sources of 
   goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.1.1:generate-sources 
   failed: Could not find tool 'aapt'. Please provide a proper Android SDK directory path as 
   configuration parameter <sdk><path>...</path></sdk> in the plugin <configuration/>. As an 
   alternative, you may add the parameter to commandline: -Dandroid.sdk.path=... or set 
   environment variable ANDROID_HOME. -> [Help 1]

After a quick search I found this really fine answer on StackOverflow and a bug report
explaining how to fix this issue on my linux environment:

    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

Because I am working on different machines, I had to fix this on at least one windows box too:

    cd $ANDROID_HOMEplatform-tools
    mklink aapt.exe ..build-toolsandroid-4.2.2aapt.exe
    mklink /D lib ..build-toolsandroid-4.2.2lib
    mklink aidl.exe ..build-toolsandroid-4.2.2aidl.exe

The original answer is available on StackOverflow and I also added
my windows version of the commands as a comment to that answer.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.