AOSP的同步问题

在这里插入图片描述

repo sync同步时提示出错:

error: .repo/manifests/: contains uncommitted changes
================================================================================
Repo command failed due to the following `UpdateManifestError` errors:
contains uncommitted changes

解决方法:

1、cd 进入.repo/manifests

cd .repo/manifests

2、执行如下三条命令

git stash
git clean -f -d

3、重新开始同步

repo sync -c -j4 --no-clone-bundle

后续:repo版本需要更新

info: A new version of repo is available
warning: repo is not tracking a remote branch, so it will not receive updates
================================================================================
Repo command failed: RepoUnhandledExceptionError
        GitCommandError: 'reset --keep v2.49.3^0' on repo failed
stderr: error: Entry 'color.py' not uptodate. Cannot merge.
fatal: Could not reset index file to revision 'v2.49.3^0'.
cd .repo/repo
git fetch --all
git reset --hard origin/master
 git pull
  1. git pull 有问题:
sing@WIN-A5BMKCI040U:~/WORK_DIRECTORY/aosp/.repo/repo$ git pull
hint: You have divergent branches and need to specify how to reconcile them.
hint: You can do so by running one of the following commands sometime before
hint: your next pull:
hint:
hint:   git config pull.rebase false  # merge (the default strategy)
hint:   git config pull.rebase true   # rebase
hint:   git config pull.ff only       # fast-forward only
hint:
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.

根据提示: git pull --rebase

  1. git pull --rebase 有问题:
sing@WIN-A5BMKCI040U:~/WORK_DIRECTORY/aosp/.repo/repo$ git pull --rebase
Auto-merging README.md
Auto-merging SUBMITTING_PATCHES.md
CONFLICT (content): Merge conflict in SUBMITTING_PATCHES.md
Auto-merging docs/internal-fs-layout.md
Auto-merging docs/manifest-format.md
Auto-merging docs/python-support.md
CONFLICT (content): Merge conflict in docs/python-support.md
Auto-merging docs/release-process.md
Auto-merging docs/repo-hooks.md
error: could not apply a99f19f... docs: add deprecated branch banner
hint: Resolve all conflicts manually, mark them as resolved with
hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
hint: You can instead skip this commit: run "git rebase --skip".
hint: To abort and get back to the state before "git rebase", run "git rebase --abort".

根据提示:

git rm SUBMITTING_PATCHES.md
git rm  docs/python-support.md
 git rebase --continue
  1. 最后再执行一下
sing@WIN-A5BMKCI040U:~/WORK_DIRECTORY/aosp/.repo/repo$ git pull
Already up to date.

后续:同步期间,仍然出现未提交提示

比如:

error: tools/test/graphicsbenchmark: Cannot remove project: uncommitted changes are present.

error: Local checkouts *not* updated.
================================================================================
Repo command failed due to the following `SyncFailFastError` errors:
error: tools/test/graphicsbenchmark: Cannot remove project: uncommitted changes are present.

我们去.repo/manifest里面,输入git status
得到:

On branch default
Your branch is up to date with 'origin/main'.

nothing to commit, working tree clean

此时,我们可以按如下操作:

cd tools/test/graphicsbenchmark/
git add .
git stash
git stash clear

最后,输入:

repo sync -j1 --fail-fast

继续同步。

03-22
### 关于AOSP下载、编译及相关文档 #### 下载AOSP源代码 为了获取最新的AOSP源代码,可以使用`repo`工具来初始化并同步仓库。以下是操作的关键步骤: 1. 安装必要的依赖项以及设置Git和Python环境[^2]。 2. 初始化Repo客户端并通过以下命令克隆AOSP存储库: ```bash repo init -u https://android.googlesource.com/platform/manifest ``` 3. 同步源代码至本地机器: ```bash repo sync ``` 此过程可能会花费较长时间,具体时间取决于网络速度和计算机性能。 #### 配置编译环境 在Ubuntu LTS版本上进行开发时,需确保安装了合适的Java Development Kit (JDK),因为不同版本的Android对JDK的要求有所不同[^4]。例如,在master分支下推荐使用OpenJDK 8;而在更早的分支(如Lollipop或Marshmallow),则应选用JDK 7。 完成基础软件包安装之后,还需要执行特定脚本来准备构建环境: ```bash source build/envsetup.sh ``` 这一步骤会加载一系列辅助函数到当前shell session中,并允许通过简单的命令访问它们[^3]。 #### 执行实际编译工作 一旦完成了上述准备工作,则可以通过运行如下指令之一来进行整个项目的构建: - 使用传统的Makefile系统: ```bash make -j$(nproc) ``` - 或者借助Soong/Kati框架加速进程: ```bash m ``` 无论哪种方式都可以实现自动化多线程处理从而缩短整体耗时。最终产物会被放置在一个预定义好的out目录里等待进一步部署或者调试用途。 如果遇到诸如“Cannot launch background server”的错误消息阻止正常结束的话,请核查是否有足够的磁盘空间可用以及其他潜在冲突因素存在[^5]。 #### 查找更多官方资料链接 对于希望深入学习如何贡献给该项目的人士来说,可以直接查阅由Google维护的相关指南页面获得最权威的信息支持。这些网页不仅涵盖了从零起步直至精通各个层面的知识要点而且还提供了常见问题解答区域能够有效帮助解决疑惑之处。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值