mac 下载编译Android源码

1、执行完命令repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-7.1.2_r8

报错 

warning: gpg (GnuPG) is not available.

warning: Installing it is strongly encouraged.

解决方案 

执行命令 brew install gnupg 安装GnuPG


2、下载报错 

fatal: Cannot get https://gerrit.googlesource.com/git-repo/clone.bundle

fatal: error [Errno 60] Operation timed out

解决方案(原因:repo的运行过程中会尝试访问官方的git源更新自己,如果想使用tuna的镜像源进行更新,可以将如下内容复制到你的~/.bashrc里)

	export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/'


3、下载报错 

GitError: --force-sync not enabled; cannot overwrite a local work tree

解放方案

开启强制更新即可 repo sync --force-sync


4、编译报错

nothing matches overlay file suw_navbar_ic_back.xml, for flavor anydpi-v21

解决方案(依赖没加)

$ 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

5、编译报错

error: error opening 'out/host/darwin-x86/obj/SHARED_LIBRARIES/libart_intermediates/gc/heap.d': No space left on device

fatal error: error in backend: IO failure on output stream.

ninja: build stopped: subcommand failed.

make: *** [ninja_wrapper] Error 1

解决方案(分区磁盘小了)

修改磁盘大小 $ sudo hdiutil resize-size<new-size-you-want>g ~/android.dmg.sparseimage


6、编译报错

FAILED: /bin/bash out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dex.rsp

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


解决方案

java -Xmx3000M -Xms1500M -XshowSettings:all 


7、编译报错

In file included from out/target/product/generic/obj/STATIC_LIBRARIES/libext4_intermediates/libipt_ECN.c:11:0:external/iptables/extensions/../include/linux/netfilter_ipv4/ipt_ECN.h:13:37:

fatal error: linux/netfilter/xt_DSCP.h: No such file or directory #include <linux/netfilter/xt_DSCP.h>

compilation terminated.make: *** [out/target/product/generic/obj/STATIC_LIBRARIES/libext4_intermediates/libipt_ECN.o] Error 1make: *** Waiting for unfinished jobs....

解决方案

将/Volumes/android/external/iptables/include/linux/netfilter_ipv4/ipt_ECN.h中的

#include <linux/netfilter/xt_DSCP.h>

改成

#include <linux/netfilter/xt_dscp.h>







评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值