Android 源码编译报错

问题1:error: tools/asuite: Cannot remove project: uncommitted changes are present.

在编译Android源码切换分支
1, 查看可切换的分支
在AOSP目录下

cd .repo/manifests
git branch -a | cut -d / -f 3

2,切换分支(以android-8.1.0_r15为例)

repo init -b android-8.1.0_r15
repo sync

出现错误如下所示
error: tools/asuite: Cannot remove project: uncommitted changes are present.

解决方法:

  1. 查看本地文件改动
    repo status
  2. 将本地修改的文件丢弃
 epo forall -c git add .
 epo forall -c git stash       
epo forall -c git stash  clear 
或者
  1. 执行命令
 repo sync -j1 --fail-fast

如果还提示,进入报错的目录
执行如下命令

git status  // 查看改动内容
git add .
git stash
git stash  clear 

再次执行repo sync -j1 --fail-fast

问题2:

destroy_build_var_cache:unset:5: var_cache_ 2ND_TARGET_GCC_VERSION ANDROID_BUILD_PATHS BUILD_OS LLVM_PREBUILTS_VERSION TARGET_ARCH TARGET_BUILD_VARIANT TARGET_DEVICE TARGET_GCC_VERSION TARGET_PLATFORM_VERSION TARGET_PRODUCT print report_config : invalid parameter name

解决方法

setopt shwordsplit
# 去除所有本地化的设置,让命令能正确执行
export LC_ALL=C

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容