Building AOSP on OS X after upgrading Xcode to 4.4

28 07 2012

I recently upgraded to OS X 10.8 Mountain Lion and Xcode 4.4, and quickly found out that the 10.6 SDK was removed from Xcode.  Unfortunately, Android requires it to build and gives an error like this when running make:

build/core/combo/ *****************************************************
build/core/combo/ * Can not find SDK 10.6 at /Applications/
build/core/combo/ * If you wish to build using higher version of SDK,
build/core/combo/ * try setting BUILD_MAC_SDK_EXPERIMENTAL=1 before
build/core/combo/ * rerunning this command
build/core/combo/ *****************************************************
build/core/combo/ *** Stop.. Stop.

To work around it, run this from Terminal:


Also, I got a compile failure after running ‘make’ under Mountain Lion:

You are attempting to build with the incorrect version
of java.

Your version is: java version “1.7.0_07”.
The correct version is: Java SE 1.6.

Please follow the machine setup instructions at
build/core/ *** stop. Stop.

Java 7 became the default JDK after the upgrade.  To switch back to Java 6, run this from Terminal:

export JAVA_HOME=`/usr/libexec/java_home -v 1.6`



4 responses

7 08 2012

Your solution seemed a bit to complicated to be “correct” so I took a deeper look at this and went in to the make file: [repo]/build/core/combo/ and changed the SDK version variable from 10.6 to 10.7 and it worked fine.

7 08 2012

Thank you! That is much simpler.

22 08 2012

Does this still work? The current version doesn’t have the line you referred to.

2 11 2012

It appears that it’s changed again. I’ll update the post. Thanks!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: