修改android aidl接口 编译失败 提示Above AIDL file(s) has changed, resulting in a different hash.

报错如下:
[ 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
  • 22
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值