Mac11.5 编译Android源代码报错汇集

  1. 问题一
    fatal: Cannot get https://gerrit.googlesource.com/git-repo/clone.bundle
    fatal: error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)
    fatal: cloning the git-repo repository failed, will remove '.repo/repo'

解决方法:
在 import sys下面添加

import ssl
ssl._create_default_https_context = ssl._create_unverified_context
  1. 问题二
    repo: command not found

解决方法:

echo 'export PATH=$PATH:$HOME/bin' >> ~/.bashrc
export PATH=$PATH:$HOME/bin
  1. 问题三

repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest
Downloading Repo source from https://gerrit-google.tuna.tsinghua.edu.cn/git-repo
fatal: Cannot get https://gerrit-google.tuna.tsinghua.edu.cn/git-repo/clone.bundle
fatal: error [Errno 0] Error
fatal: cloning the git-repo repository failed, will remove '.repo/repo'

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

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

并重启终端模拟器。

  1. 问题四

error: Unable to fully sync the tree.
error: Downloading network changes failed.
Try re-running with "-j1 --fail-fast" to exit at the first error.
carlos@carlos-virtual-machine:~/Android/source$ repo sync -j1 --fail-fast

部分代码同步失败
解决方法:

repo sync -j1 --fail-fast
  1. 问题五
    [100% 135/135] out/soong/.bootstrap/bin/soong_build out/soong/build.ninja
    FAILED: out/soong/build.ninja
    out/soong/.bootstrap/bin/soong_build -t -l out/.module_paths/Android.bp.list -b out/soong -n out -d out/soong/build.ninja.d -globFile out/soong/.bootstrap/build-globs.ninja -o out/soong/build.ninja Android.bp
    internal error: Could not find a supported mac sdk: ["10.10" "10.11" "10.12" "10.13" "10.14"]
    internal error: Could not find a supported mac sdk: ["10.10" "10.11" "10.12" "10.13" "10.14"]
    17:15:02 soong bootstrap failed with: exit status 1

failed to build some targets (25 seconds)

解决方案:
下载Maxsdks 10.14下载地址复制到/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/目录下,并修改/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Info.plist文件中的(此文件需要使用Xcode打开)
MinimumSDKVersion 为10.14

  1. 问题六
    opendir failed: .Spotlight-V100: Operation not permitted
    此问题是Mac最新系统的安全限制,按照一下步骤解决权限的限制
    解决方案:
    系统偏好设置--安全性和隐私---隐私--完全文件访问权限 选中终端。授予终端完全的访问权限

你可能感兴趣的:(Mac11.5 编译Android源代码报错汇集)