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 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

 

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

 

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值