What happened to Android AAPT?
I downloaded the most recent version of Android for Linux (android-sdk_r05-linux_86.tgz). I was trying to use the the Android Ant task(s) for packaging, building, and de开发者_高级运维ploying my code. I should mention that I'm running AMD64, but I have the 32-bit libraries installed. The Android Ant tasks are all broken.
First, the start-emulator task never gets the emulator running. It does get past starting adb, but then it just sits there.
Second, the SDK is missing the AAPT binary in the tools directory. So, the example notepad sample application will not even package correctly.
java.lang.IllegalStateException: Can't find aapt inside the sdk
at /home/user/bin/android-sdk-linux_86 at com.googlecode.autoandroid.lib.AndroidTools.locateTool(AndroidTools.java:116) at com.googlecode.autoandroid.lib.AndroidTools.startTool(AndroidTools.java:103) at com.googlecode.autoandroid.lib.AndroidTools.startTool(AndroidTools.java:91) at com.googlecode.autoandroid.lib.UnixAndroidTools.aapt(UnixAndroidTools.java:9)
I have all the dependencies configured for Android. I can run it from the command line just fine.
I assume the Ant code is out of sync with the recent SDK updates. Can anyone shed some light on this problem? At this point, I'm considering writing my own Python scripts to interact with the Android SDK. Ugh.
For anyone running into this recently, aapt moved again. It's now in $ANDROID_SDK/build-tools/17.0.0.
I have written three books all using the Android Ant build scripts. Trust me, they work.
First, the start-emulator task never gets the emulator running. It does get past starting adb, but then just sits there.
Run the android
command and launch the emulator from AVD Manager window that appears. AFAIK, there is no start-emulator
task in Ant -- in fact, I'm not aware that there ever has been one.
Second, the SDK is missing the aapt binary in the tools directory.
If you are looking in $ANDROID_HOME/tools/
(where $ANDROID_HOME
is where you unpacked the SDK), you aren't supposed to find aapt there. That directory is for tools that directly support all API levels. API-level-specific tools, like aapt
, will reside in $ANDROID_HOME/platforms/$SDK/tools/
(where $SDK
is the name of some Android version, like android-2.1
).
If you do not have anything in $ANDROID_HOME/platforms/
, please follow step 4 of the installation instructions.
精彩评论