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
相关产品推荐
相关产品推荐

