24

I met this problem when I was compiling the Android 7.1.2 source code after I updated my debian. I do not know what is the real problem . It seems problem from the flex. However, how can i solve it?

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

4
  • 1
    What is the value of LC_TIME in your shell? (locale | grep TIME will show you.) Will it work if you export LC_ALL=C first? Commented Mar 15, 2018 at 17:39
  • By the way, this is not a flex issue as such. It's a problem encountered by glibc when setlocale is called (probably). Commented Mar 15, 2018 at 17:40
  • 1
    @penf: great that you got it to work but the locale problem is a distro bug, assuming the locale is part of your distro, and should probably be reported (unless it already has been, of course). Commented Mar 16, 2018 at 14:25
  • same in my ubuntu 22 Commented May 27, 2022 at 23:41

4 Answers 4

55

Same issue for me on Ubuntu 18.04. LC_TIME was set to en_GB.UTF-8.

export LC_ALL=C

Fixed it for me

Sign up to request clarification or add additional context in comments.

1 Comment

i was also facing the same error and before make i run "export LC_ALL=C" in terminal and Issue is fixed. How to integrate this variable in android source code so that i can avoid to run before compilation .
6

I had this again recently building AOSP with Ubuntu 22.04. Setting the locale didn't work at all.

However i found this github thread which suggested to rebuild flex with

cd prebuilts/misc/linux-x86/flex
rm flex-2.5.39
tar zxf 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

which solved the error for me.

1 Comment

Thank you so much @Flo . This fixed my issue as well on ubuntu22.04 host, ubuntu22.04 docker container to build AOSP. I just can't understand why bundled flex in prebuilts/misc/linux-x86/flex is causing this problem ...
4

I built AOSP (Android O/P) downloaded from Google on a newly setup 18.04 and it built fine. Did not have to change the locale. Locale was set to en_GB.UTF-8.

Then I had to build Android N, an IMX distro, on the same machine and the build failed with the above error. After changing the locale variable the build worked fine.

1 Comment

I have same issue in ubuntu22 and android7-sourcecode
1

i was also facing the same error and before make i run "export LC_ALL=C" in terminal and Issue is fixed. How to integrate this variable in android source code so that i can avoid to run before compilation .

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.