ubuntu18.04 Android 7.1.2 编译配置

1.jdk 8安装

# apt install openjdk-8-jre-headless
# apt install openjdk-8-jdk-headless
测试:# java -version
openjdk version "1.8.0_171"
OpenJDK Runtime Environment (build 1.8.0_171-8u171-b11-0ubuntu0.18.04.1-b11)

2.安装依赖包

ubuntu18.04 编译android所需要的依赖包不是很多

# apt install g++-multilib
# apt install gperf
# apt install libxml2-utils
# apt install curl

3.编译android7.1.2

问题1error: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)

fix::在编译脚本中增加export LC_ALL=C


问题2:Out of memory error (version 1.2-rc4 'Carnac' (298900 f95d7bdecfceb327f9d201a1348397ed8a843843 by android-jack-team@google.com)).
GC overhead limit exceeded.
Try increasing heap size with java option '-Xmx<size>'.

fix:修改源码目录下prebuilts/sdk/tools/jack-admin文件的JACK_SERVER_VM_ARGUMENTS变量, 
添加-Xmx4096M(这个根据你自己的情况),接着make clean,make -j4重新构建


问题3:错误:prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/bin/ld: error: out/host/linux-x86/obj32/EXECUTABLES/libaapt2_tests_intermediates/split/TableSplitter_test.o: file is empty

fix: ln -s /usr/bin/ld.gold prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8/x86_64-linux/bin/ld


问题4:Communication error with Jack server (52). Try 'jack-diagnose'

fix:
#out/host/linux-x86/bin/jack-admin kill-server 
#out/host/linux-x86/bin/jack-admin start-server

这里写图片描述

展开阅读全文
©️2020 CSDN 皮肤主题: 大白 设计师: CSDN官方博客 返回首页
实付0元
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值