What is AAPT (Android Asset Packaging Tool) and how does it work?

AAPT allows you to view, create, and update ZIP-compatible archives (ZIP, JAR, and APK). It can also compile resources into binary assets. It is the base builder for Android applications. Of course you can ship .so files from an application, but if you want to use it, you will need reverse engineering plugins and these … Read more

Gradle finished with non-zero exit value 1 (ic_launcher.png: error: Duplicate file)

According to Xavier Durochet’s explanation on G+, it’s due to one of the libraries you use having it’s own ic_launcher.png — which they of course should not (more on that at the bottom). Chances are the two icons mentioned in the log are different: one is yours and another one is most likely the generic … Read more

Listing permissions of Android application via adb

I just wanted to combine Jason’s and Juuso’s answers together and notice that the former lists permissions that were granted, while the latter lists permissions that were requested (including ones that were granted). To see only permissions that were granted (but omitting ones that were requested but not granted) use adb shell dumpsys package packagename … Read more

Programmatically change the value of a color resource obtained from API response

You can create a class which extends Resources and override the methods getColor(int) and getColor(int, Theme). Example: colors.xml <?xml version=”1.0″ encoding=”utf-8″?> <resources> <color name=”your_special_color”>#FF0099CC</color> </resources> Res.java public class Res extends Resources { public Res(Resources original) { super(original.getAssets(), original.getDisplayMetrics(), original.getConfiguration()); } @Override public int getColor(int id) throws NotFoundException { return getColor(id, null); } @Override public int … Read more

AAPT2 compile failed: invalid dimen on Android 3.0 Canary 1

Below are mentioned four different solutions: A, B, C, and D; pick one that suites you: A) Fixing Android Studio via Ubuntu .desktop launcher file This is an Ubuntu-only alternative to the general approach on Fixing Android Studio (see below). Note that you may still want to implement the part about Fixing the shell, and … Read more

“aapt” IOException error=2, No such file or directory” why can’t I build my gradle on jenkins?

I had the following similar error on Ubuntu 13.10: Cannot run program “/usr/local/android-sdk-linux/build-tools/19.0.3/aapt”: error=2, No such file or directory And this answer fixed it for me: To get aapt working (this fixed my issues with the avd as well) just install these two packages: sudo apt-get install lib32stdc++6 lib32z1