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

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>







發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章