报错如下:
[ 2% 2/78] Verify system/netd/server/aidl_api/netd_aidl_interface/4 files have not been modified
FAILED: out/soong/.intermediates/system/netd/server/netd_aidl_interface-api/checkhash_4.timestamp
if [ $(cd ‘system/netd/server/aidl_api/netd_aidl_interface/4’ && { find ./ -name “*.aidl” -print0 | LC_ALL=C sort -z | xargs -0 sha1sum && echo 3; } | sha1sum | cut -d " " -f 1) = $(read -r <‘system/netd/server/aidl_api/netd_aidl_interface/4/.hash’ hash extra; printf %s $hash) ]; then touch out/soong/.intermediates/system/netd/server/netd_aidl_interface-api/checkhash_4.timestamp; else cat ‘system/tools/aidl/build/message_check_integrity.txt’ && exit 1; fi
###############################################################################
# ERROR: Modification detected of stable AIDL API file #
###############################################################################
Above AIDL file(s) has changed, resulting in a different hash. Hash values may
be checked at runtime to verify interface stability. If a device is shipped
with this change by ignoring this message, it has a high risk of breaking later
when a module using the interface is updated, e.g., Mainline modules.
16:47:52 ninja failed with: exit status 1
分析上述提示。提示aidl文件修改,但是hash文件没有修改。报错的目录system/netd/server/aidl_api/netd_aidl_interface/4下确实有aidl修改了。报错也提示了system/netd/server/aidl_api/netd_aidl_interface/4/.hash的值和如下命令输出要相同。
cd ‘system/netd/server/aidl_api/netd_aidl_interface/4’ && { find ./ -name “*.aidl” -print0 | LC_ALL=C sort -z | xargs -0 sha1sum && echo 3; } | sha1sum | cut -d " " -f 1
上面的命令不同平台可能有差异,只要按照错误提示的命令执行就行。
如下执行结果为a34e4f6168d32a3eed5e19910ee9180163f58c36,把这个值写入system/netd/server/aidl_api/netd_aidl_interface/4/.hash,编译通过。
$ cd 'system/netd/server/aidl_api/netd_aidl_interface/4' && { find ./ -name "*.aidl" -print0 | LC_ALL=C sort -z | xargs -0 sha1sum && echo 3; } | sha1sum | cut -d " " -f 1
a34e4f6168d32a3eed5e19910ee9180163f58c36