android 7.1.2 + ARMv7
Asked Answered
I

4

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

Ivo answered 15/3, 2018 at 14:7 Comment(4)
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?Edaedacious
By the way, this is not a flex issue as such. It's a problem encountered by glibc when setlocale is called (probably).Edaedacious
@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).Edaedacious
same in my ubuntu 22Murphey
T
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

Taxidermy answered 12/4, 2018 at 12:29 Comment(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 .Anethole
U
5

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.

Uprising answered 13/9, 2022 at 12:57 Comment(1)
Thank you so much @Uprising . 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 ...Dry
C
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.

Caulicle answered 6/6, 2018 at 15:19 Comment(1)
I have same issue in ubuntu22 and android7-sourcecodeMurphey
A
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 .

Anethole answered 1/8, 2021 at 20:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.