[Android Q&A, Help & Troubleshooting] androidtutoracademy:
I am trying to build, compile & verify the changes in Google Emulator for AOSP source code and facing the errors.

If you have history for facing such errors, please share.

#########################################

System Information :

Host OS: Win7 -Professional 64 Bit Architecture.

Guest OS: Ubuntu 16.04 (ubuntu-16.04.2-desktop-amd64.ISO loaded on VirtualBox)

AOSP Code version : android-7.1.1_r1

Command for downloaded AOSP code :

1.	mkdir ~/bin

2.	PATH=~/bin:$PATH

3.	curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo

4.	chmod a+x ~/bin/repo

5.	mkdir WORKING_DIRECTORY

6.	cd WORKING_DIRECTORY

7.	git config --global user.name "Your Name"

8.	git config --global user.email "you@example.com"

9.	repo init -u https://android.googlesource.com/platform/manifest

10.	repo init -u https://android.googlesource.com/platform/manifest -b android-7.1.1_r1

11.	repo sync

###################3

ubuntu@ubuntu:/media/ubuntu/android_code$ . build/envsetup.sh

including device/asus/fugu/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-mips64/vendorsetup.sh

including device/generic/mini-emulator-mips/vendorsetup.sh

including device/generic/mini-emulator-x86_64/vendorsetup.sh

including device/generic/mini-emulator-x86/vendorsetup.sh

including device/google/dragon/vendorsetup.sh

including device/google/marlin/vendorsetup.sh

including device/htc/flounder/vendorsetup.sh

including device/huawei/angler/vendorsetup.sh

including device/lge/bullhead/vendorsetup.sh

including device/linaro/hikey/vendorsetup.sh

including device/moto/shamu/vendorsetup.sh

including sdk/bash_completion/adb.bash

ubuntu@ubuntu:/media/ubuntu/android_code$ lunch

You're building on Linux

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. full_fugu-userdebug

8. aosp_fugu-userdebug

9. mini_emulator_arm64-userdebug

10. m_e_arm-userdebug

11. m_e_mips64-eng

12. m_e_mips-userdebug

13. mini_emulator_x86_64-userdebug

14. mini_emulator_x86-userdebug

15. aosp_dragon-userdebug

16. aosp_dragon-eng

17. aosp_marlin-userdebug

18. aosp_sailfish-userdebug

19. aosp_flounder-userdebug

20. aosp_angler-userdebug

21. aosp_bullhead-userdebug

22. hikey-userdebug

23. aosp_shamu-userdebug

Which would you like? [aosp_arm-eng] 1

ubuntu@ubuntu:/media/ubuntu/android_code$ make

============================================

PLATFORM_VERSION_CODENAME=REL

PLATFORM_VERSION=7.1.1

TARGET_PRODUCT=aosp_arm

TARGET_BUILD_VARIANT=eng

TARGET_BUILD_TYPE=release

TARGET_BUILD_APPS=

TARGET_ARCH=arm

TARGET_ARCH_VARIANT=armv7-a

TARGET_CPU_VARIANT=generic

TARGET_2ND_ARCH=

TARGET_2ND_ARCH_VARIANT=

TARGET_2ND_CPU_VARIANT=

HOST_ARCH=x86_64

HOST_2ND_ARCH=x86

HOST_OS=linux

HOST_OS_EXTRA=Linux-4.8.0-36-generic-x86_64-with-Ubuntu-16.04-xenial

HOST_CROSS_OS=windows

HOST_CROSS_ARCH=x86

HOST_CROSS_2ND_ARCH=x86_64

HOST_BUILD_TYPE=release

BUILD_ID=NMF26F

OUT_DIR=out

============================================

fatal: bad config file line 1 in .git/config

prebuilts/clang/host/linux-x86/clang-2690385/bin/clang++ -fno-exceptions -Wno-multichar -m64 -Wa,--noexecstack -fPIC -no-canonical-prefixes -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -O2 -g -fno-strict-aliasing -DNDEBUG -UDEBUG -D__compiler_offsetof=__builtin_offsetof -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument --gcc-toolchain=prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8 -fstack-protector-strong --gcc-toolchain=prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8 --sysroot prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/sysroot -target x86_64-linux-gnu -Wsign-promo -Wno-inconsistent-missing-override --gcc-toolchain=prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8 --sysroot prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/sysroot -isystem prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/include/c++/4.8 -isystem prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/include/c++/4.8/x86_64-linux -isystem prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/include/c++/4.8/backward -target x86_64-linux-gnu -c -std=c++11 -g -W -Wall -MMD -MP -O -DNOLOG -march=native -o out/host/linux-x86/obj/EXECUTABLES/ckati_intermediates/affinity.o build/kati/affinity.cc

In file included from build/kati/affinity.cc:17:

In file included from build/kati/flags.h:18:

In file included from prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/include/c++/4.8/string:40:

In file included from prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/include/c++/4.8/bits/char_traits.h:40:

In file included from prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/include/c++/4.8/bits/postypes.h:40:

In file included from prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/include/c++/4.8/cwchar:44:

prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/sysroot/usr/include/wchar.h:40:11: fatal error: 'stdarg.h' file not found

# include <stdarg.h>

^

1 error generated.

build/kati/Makefile.ckati:88: recipe for target 'out/host/linux-x86/obj/EXECUTABLES/ckati_intermediates/affinity.o' failed

make: *** [out/host/linux-x86/obj/EXECUTABLES/ckati_intermediates/affinity.o] Error 1

#### make failed to build some targets ####

ubuntu@ubuntu:/media/ubuntu/android_code$

============================================

PLATFORM_VERSION_CODENAME=REL

PLATFORM_VERSION=7.1.1

TARGET_PRODUCT=aosp_arm

TARGET_BUILD_VARIANT=eng

TARGET_BUILD_TYPE=release

TARGET_BUILD_APPS=

TARGET_ARCH=arm

TARGET_ARCH_VARIANT=armv7-a

TARGET_CPU_VARIANT=generic

TARGET_2ND_ARCH=

TARGET_2ND_ARCH_VARIANT=

TARGET_2ND_CPU_VARIANT=

HOST_ARCH=x86_64

HOST_2ND_ARCH=x86

HOST_OS=linux

HOST_OS_EXTRA=Linux-4.8.0-36-generic-x86_64-with-Ubuntu-16.04-xenial

HOST_CROSS_OS=windows

HOST_CROSS_ARCH=x86

HOST_CROSS_2ND_ARCH=x86_64

HOST_BUILD_TYPE=release

BUILD_ID=NMF26F

OUT_DIR=out

============================================

ubuntu@ubuntu:/media/ubuntu/android_code$ make clobber

============================================

PLATFORM_VERSION_CODENAME=REL

PLATFORM_VERSION=7.1.1

TARGET_PRODUCT=aosp_arm

TARGET_BUILD_VARIANT=eng

TARGET_BUILD_TYPE=release

TARGET_BUILD_APPS=

TARGET_ARCH=arm

TARGET_ARCH_VARIANT=armv7-a

TARGET_CPU_VARIANT=generic

TARGET_2ND_ARCH=

TARGET_2ND_ARCH_VARIANT=

TARGET_2ND_CPU_VARIANT=

HOST_ARCH=x86_64

HOST_2ND_ARCH=x86

HOST_OS=linux

HOST_OS_EXTRA=Linux-4.8.0-36-generic-x86_64-with-Ubuntu-16.04-xenial

HOST_CROSS_OS=windows

HOST_CROSS_ARCH=x86

HOST_CROSS_2ND_ARCH=x86_64

HOST_BUILD_TYPE=release

BUILD_ID=NMF26F

OUT_DIR=out

============================================

fatal: bad config file line 1 in .git/config

prebuilts/clang/host/linux-x86/clang-2690385/bin/clang++ -fno-exceptions -Wno-multichar -m64 -Wa,--noexecstack -fPIC -no-canonical-prefixes -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -O2 -g -fno-strict-aliasing -DNDEBUG -UDEBUG -D__compiler_offsetof=__builtin_offsetof -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument --gcc-toolchain=prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8 -fstack-protector-strong --gcc-toolchain=prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8 --sysroot prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/sysroot -target x86_64-linux-gnu -Wsign-promo -Wno-inconsistent-missing-override --gcc-toolchain=prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8 --sysroot prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/sysroot -isystem prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/include/c++/4.8 -isystem prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/include/c++/4.8/x86_64-linux -isystem prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/include/c++/4.8/backward -target x86_64-linux-gnu -c -std=c++11 -g -W -Wall -MMD -MP -O -DNOLOG -march=native -o out/host/linux-x86/obj/EXECUTABLES/ckati_intermediates/affinity.o build/kati/affinity.cc

In file included from build/kati/affinity.cc:17:

In file included from build/kati/flags.h:18:

In file included from prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/include/c++/4.8/string:40:

In file included from prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/include/c++/4.8/bits/char_traits.h:40:

In file included from prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/include/c++/4.8/bits/postypes.h:40:

In file included from prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/include/c++/4.8/cwchar:44:

prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/sysroot/usr/include/wchar.h:40:11: fatal error: 'stdarg.h' file not found

# include <stdarg.h>

^

1 error generated.

build/kati/Makefile.ckati:88: recipe for target 'out/host/linux-x86/obj/EXECUTABLES/ckati_intermediates/affinity.o' failed

make: *** [out/host/linux-x86/obj/EXECUTABLES/ckati_intermediates/affinity.o] Error 1

#### make failed to build some targets (1 seconds) ####

Please help to resolve such error

Android Noob