Android源码编译

一、编译流程

1、在源码根目录打开命令行,使用如下命令初始化编译环境

source build/envsetup.sh

2、选择编译版本

lunch xxVersion(适用于版本号已知)

lunch (从弹出的选择版本列表中选择版本)

3、make (或者make -j 并行编译, j 取cpu核心数的两倍比较适宜)

二、踩坑之旅

1、

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 [email protected])).

GC overhead limit exceeded.

Try increasing heap size with java option '-Xmx'.

 

解决:

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

 

2、ubuntu共享文件夹可见但是不可增删

[2019/01/14 20:13:23.523578, 0] ../source3/param/loadparm.c:3259(process_usershare_file)

process_usershare_file: stat of /var/lib/samba/usershares/xx failed. Permission denied

(1)方法一,参考https://stackoverflow.com/questions/25249762/process-usershare-file-stat-of-failed-permission-denied-samba

The cause is that Samba does not synchronize its users with the system. This solved the issue in my case, on Kubuntu 14.10:

sudo apt-get install libpam-smbpass sudo service samba restart

(2)由于方法1对我无效,那就用命令再赋予一次权限吧 chmod -R 777 dir

 

3、error: ext4_allocate_best_fit_partial: failed to allocate 74 blocks, out of space?

删除一些不必要的google gms包(如map,youtube)或者关闭一些宏开关

4、Can't locate Switch.pm in @INC

缺少工具,执行下面命令安装

sudo apt-get install libswitch-perl

 

你可能感兴趣的:(android,rom)