Has anyone built AOSP with Ubuntu 18.04?

14,620 views
Skip to first unread message

Jacob Abrams

unread,
May 25, 2018, 10:49:51 AM5/25/18
to Android Building
Curious if anyone out there tried to build android on Ubuntu 18.04? If so any notes you can provide on the experience?

Thanks.

Antonio Jesús Rivas Berral

unread,
May 28, 2018, 2:15:24 PM5/28/18
to Android Building

I have built Android P GSI without problems , if you try to build CAF ROM you will get flex error , its easy to solve just type the error at github search bar and you´ll find a repo with the fixed file.

Jacob Abrams

unread,
May 29, 2018, 12:45:18 PM5/29/18
to Android Building
Thanks for the confirmation. I'm having trouble with the repo forall command, does it work for you? I get this error:

repo forall -c 'pwd'
Traceback (most recent call last):
  File "/home/user/aosp/.repo/repo/main.py", line 531, in <module>
    _Main(sys.argv[1:])
  File "/home/user/aosp/.repo/repo/main.py", line 507, in _Main
    result = repo._Run(argv) or 0
  File "/home/user/aosp/.repo/repo/main.py", line 180, in _Run
    result = cmd.Execute(copts, cargs)
  File "/home/user/aosp/.repo/repo/subcmds/forall.py", line 230, in Execute
    pool = multiprocessing.Pool(opt.jobs, InitWorker)
  File "/snap/git-repo/18/usr/lib/python2.7/multiprocessing/__init__.py", line 232, in Pool
    return Pool(processes, initializer, initargs, maxtasksperchild)
  File "/snap/git-repo/18/usr/lib/python2.7/multiprocessing/pool.py", line 138, in __init__
    self._setup_queues()
  File "/snap/git-repo/18/usr/lib/python2.7/multiprocessing/pool.py", line 234, in _setup_queues
    self._inqueue = SimpleQueue()
  File "/snap/git-repo/18/usr/lib/python2.7/multiprocessing/queues.py", line 354, in __init__
    self._rlock = Lock()
  File "/snap/git-repo/18/usr/lib/python2.7/multiprocessing/synchronize.py", line 147, in __init__
    SemLock.__init__(self, SEMAPHORE, 1, 1)
  File "/snap/git-repo/18/usr/lib/python2.7/multiprocessing/synchronize.py", line 75, in __init__
    sl = self._semlock = _multiprocessing.SemLock(kind, value, maxvalue)
OSError: [Errno 13] Permission denied

See here for more details:


Jacob

Jacob Abrams

unread,
May 30, 2018, 11:27:43 AM5/30/18
to Android Building
Okay lesson learned, do not use snap to install stuff, prefer apt. I reinstalled repo command and moved on.

Now I did repo init with branch android-8.1.0_r29 and checked out that branch on all repositories and began to build aosp_arm.

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=8.1.0
TARGET_PRODUCT=aosp_arm
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_PLATFORM_VERSION=OPM1
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=
TARGET_2ND_ARCH_VARIANT=
TARGET_2ND_CPU_VARIANT=
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.15.0-20-generic-x86_64-with-Ubuntu-18.04-bionic
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=OPM4.171019.016.C1
OUT_DIR=out
AUX_OS_VARIANT_LIST=
============================================

Build ran for 8 minutes until this happened:

[  1% 943/68307] Lex: applypatch <= bootable/recovery/edify/lexer.ll
FAILED: 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.cpp
ninja: build stopped: subcommand failed.
23:35:52 ninja failed with: exit status 1

Something wrong with flex. Anyone seen something like this?

Dan Willemsen

unread,
May 30, 2018, 8:49:22 PM5/30/18
to Android Building
The old flex prebuilt has apparently been causing problems on newer OSes. I've recently replaced it on master with one built with our standard host toolchain: https://android.googlesource.com/platform/prebuilts/build-tools/+/959ea284c41b1be5283f9eca421f1124c1ff5100/linux-x86/bin/

It doesn't have any dependencies, so you should be able to just copy that file over your old one. That should be the same version as the old prebuilt, though we're likely to be updating to a newer version of flex shortly, so make sure you get the right version. (https://android-review.googlesource.com/c/platform/external/flex/+/695681)

Let me know if you run into any other issues -- we can't do much about released versions (see https://android.googlesource.com/platform/build/+/master/tools/docker for a workaround), but I am fixing issues as they come up in master.

Thanks,
Dan

--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-...@googlegroups.com
To unsubscribe from this group, send email to
android-buildi...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-buildi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yogi nit

unread,
May 31, 2018, 12:12:19 PM5/31/18
to Android Building
Enter this in terminal :

export LC_ALL=C

before giving the make command.

Jacob Abrams

unread,
May 31, 2018, 12:12:19 PM5/31/18
to Android Building
Okay solved the flex problem.

Set env variable like so:

export LC_ALL=C

Thanks:

https://stackoverflow.com/questions/49301627/android-7-1-2-armv7

Blaze Ristov

unread,
May 31, 2018, 12:12:22 PM5/31/18
to android-...@googlegroups.com
in terminal: export LANG=


--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-building@googlegroups.com

To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-building+unsubscribe@googlegroups.com.

Simao Gomes Viana

unread,
May 31, 2018, 5:54:12 PM5/31/18
to Android Building
Same thing applies to Arch Linux (and basically any OS with that issue)

I hope it will be fixed in AOSP so that we don't need the workaround.

Dan Willemsen

unread,
May 31, 2018, 6:10:23 PM5/31/18
to Android Building
Has anyone here tested with AOSP master? I believe this should be fixed.

1) The new flex binary doesn't even have NLS enabled, so it shouldn't be trying to load locale data.
2) I sanitize the various LC_* options to only pass through LC_MESSAGES, which should produce more reliable builds (LC_COLLATE was causing some build differences, etc), but retain any possible translations for error messages and the like.

- Dan


--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-...@googlegroups.com

To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-buildi...@googlegroups.com.

Yunchao Chen

unread,
Jul 6, 2018, 11:30:41 AM7/6/18
to Android Building
Yes, it works. Thanks a lot.

在 2018年6月1日星期五 UTC+8上午12:12:19,Nitin Pathak写道:

Ernest Mugadza

unread,
Sep 4, 2018, 10:42:50 AM9/4/18
to Android Building

Have tried building with Ubuntu 18.04, not working for me. I keep getting this error below and cant find how to fix this issue.


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)
[  1% 600/48810] host Java: guavalib (...RARIES/guavalib_intermediates/classes)
warning: [options] bootstrap class path not set in conjunction with -source 1.7
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.
1 warning
[  1% 600/48810] target Java: core-all...RARIES/core-all_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.

ninja: build stopped: subcommand failed.
build/core/ninja.mk:148: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1


If anyone knows how to fix this please let me know how. Thanks.

Mauro Rossi

unread,
Sep 8, 2018, 12:55:15 PM9/8/18
to Android Building
Hi,
all locale related problems can be avoided as explained by Jacob Abrams

export LC_ALL=C

M.

Nitin Pathak

unread,
Sep 11, 2018, 1:24:03 PM9/11/18
to Android Building
It is the same error Jacob was getting.
Before giving the make/lunch/brunch command

enter this in terminal

export LC_ALL=C

Simao Gomes Viana

unread,
Sep 17, 2018, 1:42:05 PM9/17/18
to Android Building

中外

unread,
Sep 18, 2018, 6:05:28 PM9/18/18
to android-...@googlegroups.com
for error information "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."
you need run below command before compile 
export LC_ALL=C

Jacob Abrams <satur...@gmail.com> 于2018年5月30日周三 下午11:27写道:
--
Reply all
Reply to author
Forward
0 new messages