works for me on AOSP master...
the code producing the error message looks like this:
function print_lunch_menu()
{
local uname=$(uname)
local choices
choices=$(TARGET_BUILD_APPS= TARGET_PRODUCT= TARGET_RELEASE=
TARGET_BUILD_VARIANT= get_build_var COMMON_LUNCH_CHOICES 2>/dev/null)
local ret=$?
echo
echo "You're building on" $uname
echo
if [ $ret -ne 0 ]
then
echo "Warning: Cannot display lunch menu."
echo
echo "Note: You can invoke lunch with an explicit target:"
echo
echo " usage: lunch [target]" >&2
echo
return
fi
so try adding
TARGET_BUILD_APPS= TARGET_PRODUCT= TARGET_RELEASE=
TARGET_BUILD_VARIANT= get_build_var COMMON_LUNCH_CHOICES
before the
choices=$(TARGET_BUILD_APPS= TARGET_PRODUCT= TARGET_RELEASE=
TARGET_BUILD_VARIANT= get_build_var COMMON_LUNCH_CHOICES 2>/dev/null)
line to see what the error is?