做过Android的人应该都知道Android编译其实挺烦的,所以以后每次遇到的问题,还是记录下来以免忘记了。以今天为例编译Android的过程中遇到一段日志扣半天,记录一下
环境是ubuntu 18.04编译Android
[ 2% 56/2683] target Java: ext (out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/classes)
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
[ 2% 59/2683] 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
上面的编译报的日志所报的是 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.
解决方法 build\envsetup.添加下面这条命令
```css
export LC_ALL=C
LC_ALL=C 是为了去除所有本地化的设置,让命令能正确执行
这条命令一般来解决是由于改了文件 的编码格式引起的问题