Nikhil Nikhil - 1 year ago 199
Android Question

Running AOSP build on Mac (Yosemite and later)

I was able to get the source code for android-5.0.1_r1 into my working directory. However, I have trouble building and running the code on an emulator because the lunch command is giving me trouble.

repo has been initialized in /Volumes/AOSPDiskImage/AOSP
Nikhils-MBP:AOSP Nikhil$ . build/
including device/asus/deb/
including device/asus/flo/
including device/asus/fugu/
including device/asus/grouper/
including device/asus/tilapia/
including device/generic/mini-emulator-arm64/
including device/generic/mini-emulator-armv7-a-neon/
including device/generic/mini-emulator-mips/
including device/generic/mini-emulator-x86/
including device/generic/mini-emulator-x86_64/
including device/lge/hammerhead/
including device/lge/mako/
including device/moto/shamu/
including device/samsung/manta/
including sdk/bash_completion/adb.bash
Nikhils-MBP:AOSP Nikhil$ lunch

You're building on Darwin

Lunch menu... pick a combo:
1. aosp_arm-eng
2. aosp_arm64-eng
3. aosp_mips-eng
4. aosp_mips64-eng
5. aosp_x86-eng
6. aosp_x86_64-eng
7. aosp_deb-userdebug
8. aosp_flo-userdebug
9. full_fugu-userdebug
10. aosp_fugu-userdebug
11. aosp_grouper-userdebug
12. aosp_tilapia-userdebug
13. mini_emulator_arm64-userdebug
14. mini_emulator_arm-userdebug
15. mini_emulator_mips-userdebug
16. mini_emulator_x86-userdebug

Which would you like? [aosp_arm-eng]

Everytime, I picked one of the options I kept getting a message that looks like:

Which would you like? [aosp_arm-eng] 6
build/core/combo/ * Can not find SDK 10.6 at
build/core/combo/ *** Stop.. Stop.

** Don't have a product spec for: 'aosp_x86_64'
** Do you have the right repo manifest?

What am I missing? What should I do?

Answer Source

Assuming you're encountering this issue on Yosemite, it's a known issue.

While there's no official workaround at the moment, assuming you have XCode installed, you should be able to fix it by symlinking your current SDK:

sudo ln -s /Developer/SDKs/MacOSX10.10.sdk /Developer/SDKs/MacOSX10.6.sdk

And then modifying build/core/combo/, and changing:

mac_sdk_versions_supported := 10.6 10.7 10.8


mac_sdk_versions_supported := 10.9 10.10

It's simply an issue with Xcode versioning and the way it was previously hardcoded into the build process.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download