0
votes

I updated my Google SDK a couple of days ago and now I cannot build the google-play-services_lib. Upon issuing an "ant release", I get the following stacktrace:

BUILD FAILED /home/abc/Java/android-sdk/tools/ant/build.xml:649: The following error occurred while executing this line:

/home/abc/Java/android-sdk/tools/ant/build.xml:694: Execute failed: java.io.IOException: Cannot run program "/home/abc/Java/android-sdk/extras/google/google_play_services/libproject/google-play-services_lib/${aapt}": java.io.IOException: error=2, No such file or directory

I cannot figure out what's causing this, I've even redownloaded the SDK and cleared everything out. The emulator works fine and I can run my code OK.

Any suggestions would be appreciated.

1
Note that Google has been advising developers for ~15 months to switch from Ant to Gradle for command-line builds. - CommonsWare
I haven't upgraded my SDK in years, which probably explains why suddenly started having issues! I'll migrate to Gradle later. - Rik Sweeney

1 Answers

3
votes

The real solution is to move to Gradle, but in the meantime I found out that setting ${aapt} and ${dx} to the location of these files fixes the issue. So until I move over the Gradle, my workaround is to set

<property name="aapt" value="${sdk.dir}/build-tools/xxx/aapt"/>
<property name="dx" value="${sdk.dir}/build-tools/xxx/dx"/>

in my build.xml (where xxx is the version android version). It is also necessary to perform an "ant clean" before issuing the "ant release" command, which can be done in one step "ant clean release".