Cannot run program aapt when trying to build an apk

On my Mac Mini I can build no problems, and don’t remember ever having to do anything with ‘appt’.

 

When I try to build on my MacBook I get this error:

/Users/MacBookPro/Android/sdk/tools/ant/build.xml:597: The following error occurred while executing this line: /Users/MacBookPro/Android/sdk/tools/ant/build.xml:649: The following error occurred while executing this line: /Users/MacBookPro/Android/sdk/tools/ant/build.xml:694: Execute failed: java.io.IOException: Cannot run program "/Applications/CoronaEnterprise/Corona/android/lib/Corona/${aapt}" (in directory "/Applications/CoronaEnterprise/Corona/android/lib/Corona"): error=2, No such file or directory

I have no idea what is wrong, I seem to have tried everything. If I got into my android sdk folder, I can see that aapt is in /Users/MacBookPro/Android/sdk/build-tools/21.1.2/aapt

It’s also in the build-tools folder for older versions, and the platform-tools folder (I think from sdk 8).  

I’ve tried adding aapt as an alias to my bash_profile.

I’ve tried killing the terminal and restarting the macbook to make sure changes had taken effect.

What have I done wrong? Why is it trying to find the appt file in the corona folder instead of in the android sdk folder? As I say, the same build script works fine on my other mac and has done for over a year.

aapt is the Android Asset Packaging Tool.  It’s included in the build-tools/version#/ folder (where version# is something like 21.1.2).  This would have been installed with the Android build tools.  You have to make sure to run the “android” command and install everything needed.  See the screen shot:

I’m the same person as corona427 (posted from one of our other accounts by mistake).  

I have definitely installed the build tools, in fact they are installed more than once because I have a few different versions of the Android SDK installed (this is also the case on my MacMini which builds fine).

tUIAzxx.png

pE122to.png

gCjgn46.png

As far as I can tell I have the same things installed here as I do on my MacMini, so I’m not sure why it doesn’t work on the Macbook.

The error message looks like it’s using ${aapt} as a variable, does this mean there should be a corresponding variable defined somewhere? I’m positive I didn’t have to do that on my other machine. In any case, I added it as an ‘export’ to my bash_profile to see if that would work. If I call appt in a terminal, it clearly finds it because it gives me the Android Asset Packaging Tool feedback (telling me what the various commands I could use are).

I’m a bit lost to say the least.

I’ll see if I can get an Engineer to chime in. 

Rob

Thanks Rob, I appreciate that it’s not a “corona problem” per se, but hopefully one of the engineers will know what the problem is.

I just saw an interesting email from Engineering the TL;DR is that Android’s 24.3.2 tools break “ant” builds but work with Android Studio.   The latest version you can use is 24.0.2 and have our building process work.

Rob

That was exactly the problem, I can start sticking some of this torn out hair back on to my head now! 

Is this SDK limit mentioned anywhere in Corona’s docs? If not, it might be worth sticking in there somewhere (even if it’s technically an Ant issue rather than a corona issue).  

Going forward does Corona have any plans to switch from ant to gradle/maven? My understanding is that using ant to build for android is deprecated now, so I’m just wondering if it could leave us short in the future.

Given we just discovered it a couple of days ago and it’s the weekend, I highly doubt we’ve documented it.  Also, Google may address this in an upcoming release.  I’ll ask Engineering about documenting it.

Rob

Our documentation has been updated to reflect this.

For anyone that was affected by this, you can download the supported version of the Android SDK Tools at: http://www.techspot.com/downloads/5425-android-sdk.html

aapt is the Android Asset Packaging Tool.  It’s included in the build-tools/version#/ folder (where version# is something like 21.1.2).  This would have been installed with the Android build tools.  You have to make sure to run the “android” command and install everything needed.  See the screen shot:

I’m the same person as corona427 (posted from one of our other accounts by mistake).  

I have definitely installed the build tools, in fact they are installed more than once because I have a few different versions of the Android SDK installed (this is also the case on my MacMini which builds fine).

tUIAzxx.png

pE122to.png

gCjgn46.png

As far as I can tell I have the same things installed here as I do on my MacMini, so I’m not sure why it doesn’t work on the Macbook.

The error message looks like it’s using ${aapt} as a variable, does this mean there should be a corresponding variable defined somewhere? I’m positive I didn’t have to do that on my other machine. In any case, I added it as an ‘export’ to my bash_profile to see if that would work. If I call appt in a terminal, it clearly finds it because it gives me the Android Asset Packaging Tool feedback (telling me what the various commands I could use are).

I’m a bit lost to say the least.

I’ll see if I can get an Engineer to chime in. 

Rob

Thanks Rob, I appreciate that it’s not a “corona problem” per se, but hopefully one of the engineers will know what the problem is.

I just saw an interesting email from Engineering the TL;DR is that Android’s 24.3.2 tools break “ant” builds but work with Android Studio.   The latest version you can use is 24.0.2 and have our building process work.

Rob

That was exactly the problem, I can start sticking some of this torn out hair back on to my head now! 

Is this SDK limit mentioned anywhere in Corona’s docs? If not, it might be worth sticking in there somewhere (even if it’s technically an Ant issue rather than a corona issue).  

Going forward does Corona have any plans to switch from ant to gradle/maven? My understanding is that using ant to build for android is deprecated now, so I’m just wondering if it could leave us short in the future.

Given we just discovered it a couple of days ago and it’s the weekend, I highly doubt we’ve documented it.  Also, Google may address this in an upcoming release.  I’ll ask Engineering about documenting it.

Rob

Our documentation has been updated to reflect this.

For anyone that was affected by this, you can download the supported version of the Android SDK Tools at: http://www.techspot.com/downloads/5425-android-sdk.html