Build Android Source Code 8.1.0 on Ubuntu 18.04 LTS

Leo Wu
Leo Wu
Sep 9, 2018 · 1 min read

Step 1: Get the source code

Follow Android’s official guide to setup environment, and download the source code.

I use the branch:

OPM6.171019.030.K1 | android-8.1.0_r46 | Oreo |Nexus 5X and Nexus 6P

Step 2: Build

make -j4

Problems

  1. Failed on lexer
[  1% 943/68307] Lex: applypatch <= bootable/recovery/edify/lexer.llFAILED: out/target/product/generic/obj/STATIC_LIBRARIES/libedify_intermediates/lexer.cpp/bin/bash -c "prebuilts/misc/linux-x86/flex/flex-2.5.39 -oout/target/product/generic/obj/STATIC_LIBRARIES/libedify_intermediates/lexer.cpp bootable/recovery/edify/lexer.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)[  1% 950/68307] target thumb C++: libapplypatch <= bootable/recovery/applypatch/applypatch.cppninja: build stopped: subcommand failed.23:35:52 ninja failed with: exit status 1

Run export LC_ALL=C in the command line before run make

Leo Wu

Written by

Leo Wu

Senior Software Engineer at Intuit GoPayment Android

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade