3
votes

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/envsetup.sh
including device/asus/deb/vendorsetup.sh
including device/asus/flo/vendorsetup.sh
including device/asus/fugu/vendorsetup.sh
including device/asus/grouper/vendorsetup.sh
including device/asus/tilapia/vendorsetup.sh
including device/generic/mini-emulator-arm64/vendorsetup.sh
including device/generic/mini-emulator-armv7-a-neon/vendorsetup.sh
including device/generic/mini-emulator-mips/vendorsetup.sh
including device/generic/mini-emulator-x86/vendorsetup.sh
including device/generic/mini-emulator-x86_64/vendorsetup.sh
including device/lge/hammerhead/vendorsetup.sh
including device/lge/mako/vendorsetup.sh
including device/moto/shamu/vendorsetup.sh
including device/samsung/manta/vendorsetup.sh
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/mac_version.mk:38:          
*****************************************************
build/core/combo/mac_version.mk:39: * Can not find SDK 10.6 at  
/Developer/SDKs/MacOSX10.6.sdk
build/core/combo/mac_version.mk:40: 
*****************************************************
build/core/combo/mac_version.mk:41: *** 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?

6
How did u fix :- ** Don't have a product spec for: 'aosp_x86_64' ** Do you have the right repo manifest?r4jiv007

6 Answers

8
votes

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/mac_version.mk, and changing:

mac_sdk_versions_supported := 10.6 10.7 10.8

to

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.

2
votes

Issue

and adding 10.11 to supporting versions in build/core/combo/mac_version.mk worked for me

2
votes

On El Capitan, none of these suggestions worked for me. I had to do the following:

  1. Downloaded XCode 5.1.1 from here: http://adcdownload.apple.com/Developer_Tools/xcode_5.1.1/xcode_5.1.1.dmg which contains SDKs 10.8 and 10.9.
  2. Ran sudo xcode-select -s /Volumes/Xcode/Xcode.app/Contents/Developer
  3. lunch
  4. make -j8

None of the other suggestions worked for me. Build (and prayer) is currently in progress.

Also see: https://code.google.com/p/android/issues/detail?id=78396

Update: This worked and continues to work for me. Only caveat is to make sure the XCode DMG is mounted each time prior to running a build. A small shell script should help automate this.

1
votes

Thanks @JFKingsley for pointing me in the right direction. The symlinking did not work because I never had the 10.6 sdk for OSX. I think that might have to with the fact I had XCode version 6.4? But what did work was editing the mac_version.mk file as JFKingsley said. Opened the file in emacs and then edited it.

1
votes

I tried the solution offered by @JFKingsley, this is my notes to completely resolve the issue:

check what SDKs you have by looking into /Developer/SDKs/

##> ls  /Developer/SDKs/
MacOSX10.11.sdk  

DO NOT create a symbolic link from heigher SDK to 10.6 as suggested in other responses - because it likely to break the compilation at some point.

Instead, edit the build/core/combo/mac_version.mk

At this line, write the SDK that you have installed

mac_sdk_versions_supported := 10.11

This should correctly solve your problem.

1
votes

For macOS High Sierra

Adding 10.13 in the build/core/combo/mac_version.mk worked for me enter image description here