問題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
出現(xiàn)錯(cuò)誤如下所示
error: tools/asuite: Cannot remove project: uncommitted changes are present.
解決方法:
- 查看本地文件改動(dòng)
repo status - 將本地修改的文件丟棄
epo forall -c git add .
epo forall -c git stash
epo forall -c git stash clear
或者
- 執(zhí)行命令
repo sync -j1 --fail-fast
如果還提示,進(jìn)入報(bào)錯(cuò)的目錄
執(zhí)行如下命令
git status // 查看改動(dòng)內(nèi)容
git add .
git stash
git stash clear
再次執(zhí)行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
# 去除所有本地化的設(shè)置疹尾,讓命令能正確執(zhí)行
export LC_ALL=C