[Android Q&A, Help & Troubleshooting] hussain03:
Hi,

I am trying to build android oreo aosp for the target car_emu_x86_64-userdebug and i am getting build error.

Steps followed:

1. repo init -u <android source url> -b android-8.0.0_r34 --depth=1

2. repo sync

3. source build/envsetup.sh

4. lunch car_emu_x86_64-userdebug

5. make -j8

error:

[ 0% 9/15494] target C++: libsurfaceflinger <= frameworks/native/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp

FAILED: out/target/product/car-x86_64/obj/SHARED_LIBRARIES/libsurfaceflinger_intermediates/DisplayHardware/FramebufferSurface.o

/bin/bash -c "PWD=/proc/self/cwd prebuilts/clang/host/linux-x86/clang-4053586/bin/clang++	-I frameworks/native/vulkan/include -I external/vulkan-validation-layers/libs/vkjson -I system/libhwbinder/fast_msgq/include -I frameworks/native/services/surfaceflinger -I out/target/product/car-x86_64/obj/SHARED_LIBRARIES/libsurfaceflinger_intermediates -I out/target/product/car-x86_64/gen/SHARED_LIBRARIES/libsurfaceflinger_intermediates -I libnativehelper/include/nativehelper \$(cat out/target/product/car-x86_64/obj/SHARED_LIBRARIES/libsurfaceflinger_intermediates/import_includes) -I system/core/include -I system/media/audio/include -I hardware/libhardware/include -I hardware/libhardware_legacy/include -I hardware/ril/include -I libnativehelper/include -I frameworks/native/include -I frameworks/native/opengl/include -I frameworks/av/include -isystem out/target/product/car-x86_64/obj/include -isystem bionic/libc/arch-x86_64/include -isystem bionic/libc/include -isystem bionic/libc/kernel/uapi -isystem bionic/libc/kernel/uapi/asm-x86 -isystem bionic/libc/kernel/android/scsi -isystem bionic/libc/kernel/android/uapi -c -fno-exceptions -Wno-multichar -O2 -Wa,--noexecstack -Werror=format-security -D_FORTIFY_SOURCE=2 -Wstrict-aliasing=2 -ffunction-sections -fno-short-enums -fstrict-aliasing -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Werror=pointer-to-int-cast -Werror=int-to-pointer-cast -Werror=implicit-function-declaration -O2 -g -fno-strict-aliasing -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -DNDEBUG -UDEBUG -fdebug-prefix-map=/proc/self/cwd= -D__compiler_offsetof=__builtin_offsetof -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument -fcolor-diagnostics -Wno-expansion-to-defined -fdebug-prefix-map=\$PWD/= -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Werror=date-time -nostdlibinc -m64 -march=x86-64 -DUSE_SSSE3 -mssse3 -msse4 -msse4.1 -msse4.2 -mpopcnt -target x86_64-linux-android -Bprebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/x86_64-linux-android/bin -Wsign-promo -Wno-inconsistent-missing-override -Wno-null-dereference -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -Wno-thread-safety-negative -std=gnu++14 -fno-rtti -DLOG_TAG="SurfaceFlinger" -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES -fvisibility=hidden -Werror=format -Wall -Werror -Wunused -Wunreachable-code -std=c++1z -fPIC -D_USING_LIBCXX -DANDROID_STRICT -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=address-of-temporary -Werror=return-type -MD -MF out/target/product/car-x86_64/obj/SHARED_LIBRARIES/libsurfaceflinger_intermediates/DisplayHardware/FramebufferSurface.d -o out/target/product/car-x86_64/obj/SHARED_LIBRARIES/libsurfaceflinger_intermediates/DisplayHardware/FramebufferSurface.o frameworks/native/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp"

frameworks/native/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp:180:18: error: no member named 'setClientTarget' in 'android::HWComposer'

mHwc.setClientTarget(mDisplayType, outSlot, outFence, outBuffer, outDataspace);

~~~~ ^

frameworks/native/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp:180:48: error: use of undeclared identifier 'outSlot'

mHwc.setClientTarget(mDisplayType, outSlot, outFence, outBuffer, outDataspace);

^

frameworks/native/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp:180:78: error: use of undeclared identifier 'outDataspace'

mHwc.setClientTarget(mDisplayType, outSlot, outFence, outBuffer, outDataspace);

^

3 errors generated.

[ 0% 15/15494] Ensuring Jack server is installed and started

Jack server already installed in "/home/abdul/.jack-server"

Launching Jack server java -XX:MaxJavaStackTraceDepth=-1 -Djava.io.tmpdir=/tmp -Dfile.encoding=UTF-8 -XX:+TieredCompilation -cp /home/abdul/.jack-server/launcher.jar com.android.jack.launcher.ServerLauncher

[ 0% 16/15494] target C++: libsurfaceflinger <= frameworks/native/services/surfaceflinger/SurfaceFlinger_hwc1.cpp

ninja: build stopped: subcommand failed.

12:08:48 ninja failed with: exit status 1

build/core/main.mk:21: recipe for target 'run_soong_ui' failed

make: *** [run_soong_ui] Error 1

#### make failed to build some targets (05:44 (mm:ss)) ####