[Nexus 6P Q&A, Help & Troubleshooting] cnstarz:
6P Devs, I need your help here. I'm a complete noob trying to learn how to just compile and build AOSP and make little changes for my own personal build. I've already successfully compiled once (after many tries and failures) but it didn't have any google services installed and it overwrote my TWRP recovery, so now I'm just trying to compile it again without recovery. However, I'm getting this error:

Starting build with ninja
ninja: Entering directory `.'
ninja: error: unknown target 'otapackage'
build/core/ninja.mk:148: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1

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

Below is the complete log. Any ideas?

android@builduntuvm:~/stock_build$ make otapackage -j8
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=7.0
TARGET_PRODUCT=aosp_angler
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=cortex-a53
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv7-a-neon
TARGET_2ND_CPU_VARIANT=cortex-a53.a57
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.4.0-42-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=NBD90X
OUT_DIR=out
============================================
Running kati to generate build-aosp_angler.ninja...
$(shell cd libcore && ls -d */src/test/{java,resources} 2> /dev/null) was changed, regenerating...
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=7.0
TARGET_PRODUCT=aosp_angler
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=cortex-a53
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv7-a-neon
TARGET_2ND_CPU_VARIANT=cortex-a53.a57
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.4.0-42-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=NBD90X
OUT_DIR=out
============================================
including ./abi/cpp/Android.mk ...
including ./art/Android.mk ...
including ./bionic/Android.mk ...
including ./bootable/recovery/Android.mk ...
including ./build/libs/host/Android.mk ...
including ./build/target/board/Android.mk ...
including ./build/target/product/security/Android.mk ...
including ./build/tools/Android.mk ...
including ./cts/Android.mk ...
FindEmulator: find: `cts/apps/CtsVerifier/src/android': No such file or directory
FindEmulator: find: `cts/hostsidetests/os/test-apps/HostLinkVerificationApp/src': No such file or directory
FindEmulator: find: `cts/libs/commonutil/src': No such file or directory
FindEmulator: cd: cts/tests/libcore/ojluni/resources: No such file or directory
FindEmulator: find: `cts/libs/commonutil/src': No such file or directory
<Snip>
build/core/package_internal.mk:143: Empty argument supplied to find-subdir-assets
<Snip>
including ./external/dbus-binding-generator/Android.mk ...
including ./external/dbus/Android.mk ...
including ./external/deqp/Android.mk ...
build/core/binary.mk:1196: external/deqp/Android.mk: libdeqp: Unused source files: \
build/core/binary.mk:1196: external/deqp/Android.mk: libdeqp: Unused source files: \
including ./external/dexmaker/Android.mk ...
including ./external/dhcpcd-6.8.2/Android.mk ...
including ./external/dng_sdk/Android.mk ...
including ./external/dnsmasq/Android.mk ...
<Snip>
including ./external/modp_b64/Android.mk ...
including ./external/mp4parser/Android.mk ...
including ./external/mtpd/Android.mk ...
<Snip>
including ./external/pdfium/third_party/Android.mk ...
build/core/binary.mk:1196: external/pdfium/third_party/pdfiumbigint.mk: libpdfiumbigint: Unused source files: bigint/BigInteger.cc bigint/BigIntegerUtils.cc bigint/BigUnsigned.cc bigint/BigUnsignedInABase.cc
build/core/binary.mk:1196: external/pdfium/third_party/pdfiumbigint.mk: libpdfiumbigint: Unused source files: bigint/BigInteger.cc bigint/BigIntegerUtils.cc bigint/BigUnsigned.cc bigint/BigUnsignedInABase.cc
including ./external/piex/Android.mk ...
including ./external/ppp/pppd/Android.mk ...
<Snip>
including ./frameworks/av/tools/resampler_tools/Android.mk ...
including ./frameworks/base/Android.mk ...
build/core/package_internal.mk:143: Empty argument supplied to find-subdir-assets
including ./frameworks/compile/libbcc/Android.mk ...
<Snip>
including ./frameworks/native/vulkan/Android.mk ...
including ./frameworks/opt/bitmap/Android.mk ...
including ./frameworks/opt/bluetooth/Android.mk ...
FindEmulator: find: `frameworks/opt/bluetooth/src/android/bluetooth/client/pbap': No such file or directory
including ./frameworks/opt/calendar/Android.mk ...
including ./frameworks/opt/chips/Android.mk ...
including ./frameworks/opt/colorpicker/Android.mk ...
<Snip>
including ./frameworks/opt/net/wifi/tests/Android.mk ...
find: ‘out/target/common/obj/SHARED_LIBRARIES/libwifi-hal-mock_intermediates’: No such file or directory
including ./frameworks/opt/photoviewer/Android.mk ...
including ./frameworks/opt/setupwizard/library/Android.mk ...
including ./frameworks/opt/setupwizard/navigationbar/Android.mk ...
including ./frameworks/opt/telephony/Android.mk ...
including ./frameworks/opt/timezonepicker/Android.mk ...
including ./frameworks/opt/vcard/Android.mk ...
including ./frameworks/rs/Android.mk ...
including ./frameworks/support/Android.mk ...
FindEmulator: find: `frameworks/support/design/dummy': No such file or directory
FindEmulator: find: `frameworks/support/v17/leanback/dummy': No such file or directory
FindEmulator: find: `frameworks/support/v17/preference-leanback/dummy': No such file or directory
including ./frameworks/volley/Android.mk ...
including ./frameworks/webview/Android.mk ...
<Snip>
including ./packages/apps/CertInstaller/Android.mk ...
including ./packages/apps/Contacts/Android.mk ...
FindEmulator: find: `packages/apps/Contacts/src-N': No such file or directory
FindEmulator: find: `packages/apps/PhoneCommon/src-N': No such file or directory
including ./packages/apps/DeskClock/Android.mk ...
including ./packages/apps/DevCamera/Android.mk ...
including ./packages/apps/Dialer/Android.mk ...
FindEmulator: find: `packages/apps/Dialer/InCallUI/src-N': No such file or directory
FindEmulator: find: `packages/apps/PhoneCommon/src-N': No such file or directory
including ./packages/apps/Email/Android.mk ...
including ./packages/apps/EmergencyInfo/Android.mk ...
including ./packages/apps/ExactCalculator/Android.mk ...
<Snip>
including ./packages/screensavers/WebView/Android.mk ...
including ./packages/services/Car/Android.mk ...
FindEmulator: find: `packages/services/Car/car-support-lib/dummy': No such file or directory
including ./packages/services/Mms/Android.mk ...
including ./packages/services/Telecomm/Android.mk ...
including ./packages/services/Telephony/Android.mk ...
including ./packages/wallpapers/LivePicker/Android.mk ...
including ./pdk/apps/HelloPDK/Android.mk ...
including ./pdk/apps/TestingCamera/Android.mk ...
including ./pdk/apps/TestingCamera2/Android.mk ...
including ./platform_testing/libraries/annotations/Android.mk ...
including ./platform_testing/libraries/app-helpers/Android.mk ...
FindEmulator: find: `platform_testing/libraries/app-helpers/src': No such file or directory
FindEmulator: find: `platform_testing/libraries/app-helpers/src': No such file or directory
including ./platform_testing/libraries/aupt-lib/Android.mk ...
including ./platform_testing/libraries/base-app-helpers/Android.mk ...
including ./platform_testing/libraries/chrome-app-helper/Android.mk ...
<Snip>
including ./prebuilts/qemu-kernel/x86/pc-bios/Android.mk ...
including ./prebuilts/sdk/Android.mk ...
including ./prebuilts/tools/Android.mk ...
FindEmulator: find: `prebuilts/tools/android-arm64': No such file or directory
including ./sdk/annotations/Android.mk ...
including ./sdk/avdlauncher/Android.mk ...
<Snip>
including ./system/webservd/Android.mk ...
including ./tools/external/fat32lib/Android.mk ...
PRODUCT_COPY_FILES device/generic/goldfish/data/etc/apns-conf.xml:system/etc/apns-conf.xml ignored.
PRODUCT_COPY_FILES device/huawei/angler/fstab.angler:root/fstab.angler ignored.
build/core/binary.mk:664: warning: overriding commands for target `out/host/linux-x86/gen/STATIC_LIBRARIES/libaapt2_intermediates/proto/frameworks/base/tools/aapt2/Format.pb.cc'
build/core/binary.mk:664: warning: ignoring old commands for target `out/host/linux-x86/gen/STATIC_LIBRARIES/libaapt2_intermediates/proto/frameworks/base/tools/aapt2/Format.pb.cc'
build/core/binary.mk:668: warning: overriding commands for target `out/host/linux-x86/gen/STATIC_LIBRARIES/libaapt2_intermediates/proto/frameworks/base/tools/aapt2/Format.pb.h'
build/core/binary.mk:668: warning: ignoring old commands for target `out/host/linux-x86/gen/STATIC_LIBRARIES/libaapt2_intermediates/proto/frameworks/base/tools/aapt2/Format.pb.h'
Starting build with ninja
ninja: Entering directory `.'
ninja: error: unknown target 'otapackage'
build/core/ninja.mk:148: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1

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