Sunday, 20 January 2013

Android eclipse ERROR: Unknown option ‘–auto-add-overlay’

I had an abnormal shutdown of my mac and when it came back up, Eclipse would no longer compile my project correctly and throws the following error :
Unknown option ‘–auto-add-overlay’
Solution 1 :
The error is coming from the aapt command, which seems to be installed multiple times, once for each SDK version:
bramp@Andrew-laptop:~$ locate -r aapt$
Checking each command I see that only versions 7 and 8 have the –auto-add-overlay option. Both my library and main projects are targeted at Android 1.6 (i.e. android-4). I tried re-targeting my main project to Android 2.2 (i.e. android-8) and the problem seems to go away.

So for the moment this seems an annoyance, but I can live with it by setting my target to 2.2. Hopefully Google will release a fix so I can still use the older targets with the new library feature.
Just a quick update:I noticed that on Windows all versions of the aapt tool support the ‘–auto-add-overlay’ option. So what I suspect has happened is that someone forgot to update the aapt binary for the old platforms.
Solution 2 :
Delete <SDK>/platforms/android-3 and android-3 and redownload them


Post a Comment