I've tried every advertised method to specify the path to my Android SDK when trying to build an Android app using the android-maven-plugin, and nothing works. No matter what I do, when I run
mvn clean install
I get
... 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.
I set env variable ANDROID_HOME to point to the root directory of the SDK, and exported it. Then
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
...
<configuration>
<sdk>
<path>${env.ANDROID_HOME}</path>
<platform>19</platform>
</sdk>
...
</configuration>
</plugin>
does not work. (and I have API 19 installed in the SDK)
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
...
<configuration>
<sdk>
<path>/absolute/path/to/sdk</path>
<platform>19</platform>
</sdk>
...
</configuration>
</plugin>
does not work
<properties>
<android.sdk.path>/absolute/path/to/sdk</android.sdk.path>
</properties>
Does not work. And
mvn clean install -Dandroid.sdk.path=/absolute/path/to/sdk
Does not work.
I've also tried appending the tools, platform-tools, and build-tools/19.1.1 directories in the SDK to $PATH, and this does not work either. The aapt tool is available on my path, but the maven plugin refuses to see it. I searched the web, and the only advice I see is to do what I've done.
What am I missing? I'm doing this on an OSX system.