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/HOST_darwin-x86.mk:62: *****************************************************
build/core/combo/HOST_darwin-x86.mk:63: * Can not find SDK 10.6 at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk
build/core/combo/HOST_darwin-x86.mk:65: * If you wish to build using higher version of SDK,
build/core/combo/HOST_darwin-x86.mk:66: * try setting BUILD_MAC_SDK_EXPERIMENTAL=1 before
build/core/combo/HOST_darwin-x86.mk:67: * rerunning this command
build/core/combo/HOST_darwin-x86.mk:69: *****************************************************
build/core/combo/HOST_darwin-x86.mk:70: *** Stop.. Stop.

To work around it, run this from Terminal:

export BUILD_MAC_SDK_EXPERIMENTAL=1

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
https://source.android.com/source/download.html
************************************************************
build/core/main.mk:141: *** 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`
Advertisements

Actions

Information

4 responses

7 08 2012
Henrik

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/HOST_darwin-x86.mk and changed the SDK version variable from 10.6 to 10.7 and it worked fine.

7 08 2012
Charlie

Thank you! That is much simpler.

22 08 2012
Sena

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

2 11 2012
Charlie

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:

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s




%d bloggers like this: