首先准备一个linux环境,本人使用的是ubuntu18.04
1.硬盘空间最好200G+
2.更新下系统到最新。sudo apt-get update ;sudo apt-get upgrade
3.准备压缩包rk3326sdk8.1-7072-20190121.tar.gz
4.解压出来 tar -zxvf rk3326sdk8.1-7072-20190121.tar.gz. 需要很久17G+的压缩包
5.安装java8 sudo apt-get update;sudo apt-get install openjdk-8-jdk
6.配置java环境
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar
7.安装依赖包
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl
zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev
x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils
xsltproc unzip
8.安装lz4c ,解决下图问题 sudo apt-get install liblz4-tool
缺少第三方库类似问题 sudo apt-get install m4
9.安装交叉编译的库,不然会报错sudo apt-get install gcc-multilib
10.扩展下swap,8g内存一下的会报内存不足,最好交换空间设置16G
链接在这https://blog.csdn.net/Csdoker/article/details/80170548
11.这个错误的话,改下内存大小
FAILED: out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dex
/bin/bash out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dex.rsp
Out of memory error (version 1.3-rc7 'Douarn' (445000 d7be3910514558d6715ce455ce0861ae2f56925a by android-jack-team@google.com)).
GC overhead limit exceeded.
Try increasing heap size with java option '-Xmx<size>'.
解决方案
export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4g"
./prebuilts/sdk/tools/jack-admin kill-server
./prebuilts/sdk/tools/jack-admin start-server
12.这个错误 _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
解决方案
添加完之后记得source .bashrc 不然不生效
地址:
https://stackoverflow.com/questions/49955137/error-when-build-lineageos-make-ninja-wrapper-error-1
13没有python。。。。
就装个python --------- sudo apt-get install python
花了一天终于编好了,最好用服务器编CPU核越多越好,内存得8G+,硬盘 至少200G,编完只剩30G(删除压缩包的情况)
加油
网友评论