[Build android source code fail] recipe for target 'ninja_wrapper' failed

Hi,

I was tried to build android source following this guide:
http://docs.khadas.com/develop/BuildAndroid/
I’ve made full set up before building but still got error:
build/core/ninja.mk:148: recipe for target ‘ninja_wrapper’ failed
I attached log and ninja.mk file.
http://textuploader.com/dl62p
http://textuploader.com/dl62z
Please help me to resolve this issue.
Thank you!

You need to build U-Boot before building android.
You can following this to build android for VIM2.

Build U-Boot

$ cd ~/project/khadas/nougat/uboot
$ make CROSS_COMPILE=aarch64-linux-gnu- kvim2_defconfig
$ make CROSS_COMPILE=aarch64-linux-gnu-


Build Android:

$ cd ~/project/khadas/nougat
$ source build/envsetup.sh
$ lunch kvim2-userdebug-64
$ make -jN otapackage

Hi Terry,

It’s my mistake when cd wrong destination folder. But,
I’ve already built uboot before building android source code according this guidance: http://docs.khadas.com/develop/BuildAndroid/
There is no problem when buiding uboot. But, i got an NEW another error when buiding source code.
I Attached log for uboot build:
http://textuploader.com/dljy3
Log for build source code:
http://textuploader.com/dljbt
So, help me to check this issue plz! Thank you!

Did you Establish a Build Environment for your host PC?
Can you also provide the information about PATH environment for me?

terry@Server:~$  echo $PATH
/home/terry/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

Hi Terry,

Before building android source code, i’ve already setup all requirements but i don’t remember is there any error, isn’t?
This is PATH environment info:
mike@mike-VirtualBox:~$ echo $PATH
/home/mike/bin:/home/mike/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
mike@mike-VirtualBox:~$

Maybe you forgot to install some tools.You can try to check the exist of m4 exec and install it.

terry@terry:~$ m4 --help
terry@terry:~$ sudo apt-get install m4

Hi,

I’ve got new exception: fatal: fork: Cannot allocate memory
Here is log: http://textuploader.com/dlxkw
How can i fix it?

What’s the size of your memory? Maybe it is too small.