ninja error

1,733 views
Skip to first unread message

Kiran Kaur

unread,
Sep 18, 2023, 10:16:29 PM9/18/23
to Android Building
hi Team,

I am new to AOSP and trying to build android for raspberry pi 4b but while running make command
  "make bootimage systemimage vendorimage -j$(nproc) "
for
"lunch rpi4_car-eng"
I am getting following error.
09:30:53 Build sandboxing disabled due to nsjail error.
PLATFORM_VERSION=13
TARGET_PRODUCT=rpi4_car
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=cortex-a72
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.4.0-22621-Microsoft-x86_64-Ubuntu-22.04.3-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=TQ3C.230805.001.B2
OUT_DIR=out
============================================
FAILED: ninja: out/soong/bootstrap.ninja:12: loading 'out/soong/globs-build.ninja': Exec format error
subninja out/soong/globs-build.ninja
                                    ^ near here
09:31:47 soong bootstrap failed with: exit status 1

#### failed to build some targets (19 seconds) ####


    I tried to search for this error but with no solution.
    Any suggestions on this can solve my problem.
Thanks & Regards
Kirandeep Kaur

enh

unread,
Sep 19, 2023, 10:01:20 AM9/19/23
to android-...@googlegroups.com
looks like you're using WSL --- use real Linux instead. (or
https://github.com/android/ndk/issues/1755 suggests that WSL2 might
work better than WSL1.)
> --
> --
> 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.
> To view this discussion on the web visit https://groups.google.com/d/msgid/android-building/fef802bc-9f0f-44dd-ae55-962958b3a840n%40googlegroups.com.

Kiran Kaur

unread,
Sep 21, 2023, 4:33:34 PM9/21/23
to android-...@googlegroups.com
Updating wsl1 to wsl2 resolved my following errors.
09:30:53 Build sandboxing disabled due to nsjail error.
FAILED: ninja: out/soong/bootstrap.ninja:12: loading 'out/soong/globs-build.ninja': Exec format error
subninja out/soong/globs-build.ninja
                                    ^ near here
09:31:47 soong bootstrap failed with: exit status 1

But now when I am running this command 
make bootimage systemimage vendorimage -j12
I am getting the following error. I think it requires more memory. I am running with 16GB of ram that only allocates 13.5GB.

FAILED: out/soong/build.ninja
cd "$(dirname "out/host/linux-x86/bin/soong_build")" && BUILDER="$PWD/$(basename "out/host/linux-x86/bin/soong_build")" && cd / && env -i  "$BUILDER"     --top "$TOP"     --soong_out "out/soong"     --out "out"     -o out/soong/build.ninja --globListDir build --globFile out/soong/globs-build.ninja -t -l out/.module_paths/Android.bp.list --available_env out/soong/soong.environment.available --used_env out/soong/soong.environment.used.build Android.bp
Killed
16:14:39 soong bootstrap failed with: exit status 1
ninja: build stopped: subcommand failed.


enh

unread,
Sep 21, 2023, 4:45:24 PM9/21/23
to android-...@googlegroups.com
yeah, it _may_ be possible, but i don't know of anyone who uses less
than 64GiB, and i think we've heard from people having trouble
building with 32GiB. 16GiB is definitely too little.
> To view this discussion on the web visit https://groups.google.com/d/msgid/android-building/CAJTLbrQvpo9QMgnV6SE0RGmthnWRARtKBD1gwDfjpmMR99_a_g%40mail.gmail.com.

Kiran Kaur

unread,
Sep 29, 2023, 4:33:01 PM9/29/23
to android-...@googlegroups.com
Thanku so much for your reply.
Yes. I am using Windows 11 and installed Ubuntu via the command "wsl --install -d ubuntu". Do I need to uninstall Windows and install Ubuntu on my system?

On Tue, Sep 19, 2023 at 10:01 AM 'enh' via Android Building <android-...@googlegroups.com> wrote:

Yael Schwartzbard

unread,
Sep 29, 2023, 4:35:03 PM9/29/23
to Android Building
I had the same problem with machine  with 32 gib 
only on the main branch, when I switch to specific flag it works, and when I change to 64 gib it worked with main branch also

ב-יום חמישי, 21 בספטמבר 2023 בשעה 17:45:24 UTC-3, enh כתב/ה:

Balaji BABU T.R.

unread,
Oct 5, 2023, 10:48:40 AM10/5/23
to android-...@googlegroups.com
Hi Kiran,

In your system more than 16 GB RAM then it will build without any issue.

Thanks,
Balaji 

Kiran Kaur

unread,
Oct 5, 2023, 10:48:50 AM10/5/23
to android-...@googlegroups.com
I got the solution to solve build error due to 16gb ram by creating a swap file and by allocating the specific memory required to run the build command and it worked for me.

Balaji BABU T.R.

unread,
Oct 5, 2023, 10:23:37 PM10/5/23
to android-...@googlegroups.com
Hi Kiran,

Great.  Still are you using 16 GB RAM 

Please share the creating a swap file commands



Thanks,
Balaji 


Reply all
Reply to author
Forward
0 new messages