23

At work, I need to use maven with Android.

maven uses appt.exe for its own compiling process.

ever since I've upgraded to ADT 22 , maven says it can't find this file, and it's right- the file is gone from "...\platform-tools" .

I've tried to uninstall&re-install the sdk manager and the ADT , but it didn't help.

What can I do to fix this ?

Why is it gone?


EDIT:

For now, I use a workaround of copying (without replacing) all of the old "platform-tools" files into the current one. It seems to work, but maybe it could cause problems.

android developer
  • 114,585
  • 152
  • 739
  • 1,270

4 Answers4

36

It's moved to:

path/to/your/android-sdk/build-tools/17.0.0/...

I'm assuming this it to ad versioning to the build tools.

We need the android-maven-plugin to do a fix! As its looking for the files under platform-tools/... which of course they are not anymore.

Update - Fixed

Update your pom.xml to 3.6.0 (or greater). The android-maven-plugin has been updated to support the new structure.

See 3.6.0 Released

<plugin>
    <groupId>com.jayway.maven.plugins.android.generation2</groupId>
    <artifactId>android-maven-plugin</artifactId>
    <version>3.6.0</version>
    <inherited>true</inherited>
    <configuration>
        <sdk>
            <platform>${android.platform}</platform>
        </sdk>
     </configuration>
</plugin>

Temp Fix (Old - See Fix)

As mentioned by the OP, copy the files from /build-tools/17.0.0/... to /platform-tools until the maven plugin is fixed.

For unix users

cp -r build-tools/17.0.0/* platform-tools/

From your android sdk folder.

Chris.Jenkins
  • 13,051
  • 4
  • 60
  • 61
  • where is the "android-sdk-os" folder? why did they change it? – android developer May 16 '13 at 11:32
  • @androiddeveloper Sorry, the path where you installed the android sdk. I think on windows by default its in your profile directory. – Chris.Jenkins May 16 '13 at 11:43
  • @androiddeveloper as for why? They are moving to Gradle for the build system, if your using different versions of the build system, it will use the correct build tools incase things change majorly. It makes sense in the long run, just a pain while we transition. It is for the best tho. – Chris.Jenkins May 16 '13 at 11:45
  • Maven to use what? I have copied the files back into `platform-tools` and maven is working for me, but this is not a fix, just a work around. – Chris.Jenkins May 16 '13 at 13:18
  • i meant, can i set maven to use the path of ".../build-tools/17.0.0/" ? – android developer May 16 '13 at 13:32
  • @androiddeveloper Maven needs ANDROID_HOME set, Which points at the android sdk root folder. So setting that to `build-tools...` would not help as its a different sub folder anyway – Chris.Jenkins May 16 '13 at 14:21
  • ok. sorry. i'm a huge newb with maven. sure hope that google's new tool will convince people i work with to work with it instead, and that it's really better than maven . – android developer May 16 '13 at 14:57
  • 2
    If you're on a UNIX based system symbolic linking works well for this instead of copying. – Neal Sanche May 19 '13 at 17:40
  • @Thorinside plus one for the symbolic link. Inside the platform-tools folder: ln ../build-tools/17.0.0/aapt aapt – Joao Sousa Jun 01 '13 at 13:32
8

The correct fix is to clone the android-maven-plugin wich is actually up to date with the latest developper tools but not yet released in central maven repository :

Clone the android-maven-plugin on GitHub and install it in your repo

git clone https://github.com/jayway/maven-android-plugin.git
cd .../maven-android-plugin/
mvn clean install

Then update your pom to use version 3.5.4-SNAPSHOT of the plugin. Everything should work properly !

avianey
  • 5,545
  • 3
  • 37
  • 60
  • This is the real workaround. I only has installed the lasted platform so I need to skip test to compile, changing the last command to `mvn clean install -Dmaven.test.skip=true`. Hope it helps! – sabadow May 19 '13 at 13:12
1

You need add ~/sdk/build-tools to you $PATH

Crossle Song
  • 10,104
  • 2
  • 29
  • 38
0

Just make sure you've installed Build-tools. Unfortunately you need to run SDK manager twice. For the first time to upgrade Tools to revision 22, then close it (reload from menu doesn't work) and run again. After refresh you'll see an update of Platform-Tools to revision 17 and new package called Build-tools that contains aapt.

Hope it helps.

durzy
  • 555
  • 4
  • 8