'Error when build LineageOS: "make: *** [ninja_wrapper] Error 1"

frameworks/av/camera/cameraserver/Android.mk:18: Target has integrated cameraserver into mediaserver. This is weakening security measures introduced in 7.0
find: ‘/home/xuanan/android/lineage/out/target/common/obj/SHARED_LIBRARIES/libwifi-hal-mock_intermediates’: No such file or directory
Starting build with ninja
ninja: Entering directory `.'
[  0% 14/48263] Lex: aidl <= system/tools/aidl/aidl_language_l.ll
FAILED: /bin/bash -c "prebuilts/misc/linux-x86/flex/flex-2.5.39 -o/home/xuanan/android/lineage/out/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)
[  0% 14/48263] target Java: libprotob...tobuf-java-nano_intermediates/classes)
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
[  0% 14/48263] target Java: libphonen...number-platform_intermediates/classes)
ninja: build stopped: subcommand failed.
build/core/ninja.mk:151: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1
make: Leaving directory '/home/xuanan/android/lineage'

I am trying to to build LineageOS for my device A6020. I did everything mention in official lineageos build guide for my device. But at the building step i encounter above error, at only less than 2 minutes after i enter brunch A6020. I would really appreciate if anyone can help me out since this is my school project. English is not my main language but i hope you guys can understand me. Thanks in advance. picture of terminal when encounter error



Solution 1:[1]

This will do the trick:

export LC_ALL=C

Add it to your bashrc file or equivalent.

Solution 2:[2]

I made it past this error by adding the following variables before building.

export LC_ALL=C

This error occurred later

FAILED: setup-jack-server when building LineageOS

I solved by edit java.security file under /etc/java-8-openjdk/security/

https://stackoverflow.com/a/72038963/10941856

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 frogatto
Solution 2 e.moradi