You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

AOSP同步失败:RepoUnhandledExceptionError(进程数需至少为1)

解决AOSP同步时的「Number of processes must be at least 1」错误

问题重现

执行以下命令同步AOSP代码时触发错误:

$ repo init --partial-clone -b main -u https://android.googlesource.com/platform/manifest -groups=all,-notdefault,-device,-darwin
repo has been initialized in /home/user/projects/aosp

$ repo sync
Fetching: 0, done in 0.007s
Fetching: 0,================================================================================
Repo command failed: RepoUnhandledExceptionError
    Number of processes must be at least 1

解决方案

这个错误是因为repo工具的并发进程数被设置为0,按以下方法修复:

  • 临时设置并发数:在当前终端执行环境变量设置命令,再重新同步

    export REPO_PROCESSES=4
    repo sync
    

    数字4可根据你的CPU核心数调整,比如8或16。

  • 永久配置并发数:修改repo的配置文件,在初始化后的.repo/repo/config中,找到[repo]段,添加或修改进程数配置:

    [repo]
        processes = 4
    

    保存后执行repo sync即可。

  • 同步时直接指定进程数:在sync命令中通过-j参数指定并发进程数

    repo sync -j4
    

内容的提问来源于stack exchange,提问作者satur9nine

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.16 08:39:51