Ubuntu18.04编译Android源码报[run_soong_ui] Error 1错误

Jack server already installed in "/home/andforce/.jack-server"
Server is already running
[  0% 20/22479] //system/tools/aidl:libaidl-common lex aidl_language_l.ll [linux]
FAILED: out/soong/.intermediates/system/tools/aidl/libaidl-common/linux_x86_64_static/gen/lex/system/tools/aidl/aidl_language_l.cpp 
prebuilts/misc/linux-x86/flex/flex-2.5.39 -oout/soong/.intermediates/system/tools/aidl/libaidl-common/linux_x86_64_static/gen/lex/system/tools/aidl/aidl_language_l.cpp system/tools/aidl/aidl_language_l.ll
flex-2.5.39: loadlocale.c:130: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
Aborted (core dumped)
[  0% 29/22479] //system/tools/aidl:libaidl-common clang++ type_cpp.cpp [linux]
ninja: build stopped: subcommand failed.
14:06:11 ninja failed with: exit status 1

或者出现下面的错误:

[ 85% 6/7] glob packages/apps/*/Android.bp
[  0% 6/23064] Ensuring Jack server is installed and started
Jack server already installed in "/home/andforce/.jack-server"
Server is already running
[  0% 30/23064] //system/tools/aidl:libaidl-common lex aidl_language_l.ll [linux]
FAILED: out/soong/.intermediates/system/tools/aidl/libaidl-common/linux_x86_64_static/gen/lex/system/tools/aidl/aidl_language_l.cpp 
prebuilts/misc/linux-x86/flex/flex-2.5.39 -oout/soong/.intermediates/system/tools/aidl/libaidl-common/linux_x86_64_static/gen/lex/system/tools/aidl/aidl_language_l.cpp system/tools/aidl/aidl_language_l.ll
flex-2.5.39: loadlocale.c:130: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
Aborted (core dumped)
ninja: build stopped: subcommand failed.
13:17:12 ninja failed with: exit status 1
build/core/main.mk:21: recipe for target 'run_soong_ui' failed
make: *** [run_soong_ui] Error 1
Starting build with ninja
ninja: Entering directory `.'
[  0% 1/4147] Lex: aidl <= system/tools/aidl/aidl_language_l.ll
FAILED: /bin/bash -c "prebuilts/misc/linux-x86/flex/flex-2.5.39 -oout/host/linux-x86/obj/STATIC_LIBRARIES/libaidl-common_intermediates/aidl_language_l.cpp system/tools/aidl/aidl_language_l.ll"
flex-2.5.39: loadlocale.c:130: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
Aborted (core dumped)
ninja: build stopped: subcommand failed.
build/core/ninja.mk:148: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1