I am getting below error while trying to build Lollipop 5.1.1 AOSP on Ubuntu 18.04.
build/core/Makefile:34: warning: overriding recipe for target 'out/target/product/apq8084/system/etc/permissions/android.hardware.sensor.stepdetector.xml'
build/core/base_rules.mk:550: warning: ignoring old recipe for target 'out/target/product/apq8084/system/etc/permissions/android.hardware.sensor.stepdetector.xml'
No private recovery resources for TARGET_DEVICE apq8084
Lex: aidl <= frameworks/base/tools/aidl/aidl_language_l.l
/bin/bash: prebuilts/misc/linux-x86/flex/flex-2.5.39: Is a directory
build/core/binary.mk:575: recipe for target 'out/host/linux-x86/obj32/EXECUTABLES/aidl_intermediates/aidl_language_l.cpp' failed
make: *** [out/host/linux-x86/obj32/EXECUTABLES/aidl_intermediates/aidl_language_l.cpp] Error 126
make: *** Waiting for unfinished jobs....
host C++: libaapt_32 <= frameworks/base/tools/aapt/AaptXml.cpp
make: *** wait: No child processes. Stop.
#### make failed to build some targets (01:06 (mm:ss)) ####
Any Idea why this happens?
I tried "export LC_ALL=C" but didn't help.
I rebuild the flex package and the issue got resolved.
cd prebuilts/misc/linux-x86/flex
rm flex-2.5.39
tar zvxf flex-2.5.39.tar.gz
cd flex-2.5.39
./configure
make
mv flex ../
cd ../
rm -rf flex-2.5.39
mv flex flex-2.5.39