为什么要make update -api ???

最近修改了framework/base/media 路径下的Java文件,导致全编报错

1.错误信息类似
............
******************************
You have tried to change the API from what has been previously approved.
To make these errors go away, you have two choices:
    1) You can add "@hide" javadoc comments to the methods, etc. listed in the
      errors above.

    2) You can update current.txt by executing the following command:
         make update-api
      To submit the revised current.txt to the main Android repository,
      you will need approval.
******************************
...........

2.问题原因分析和解决办法

2.1.错误信息表明是由于API错误导致, 进一步研究发现:谷歌对于所有的类和API,分为开方和非开放两种,而开放的类和API,可以通过“Javadoc标签”与源码同步生成“程序的开发文档”;当我们修改或者添加一个新的API时,我们有两种方案可以避免出现上述错误,其一是将该接口加上 非公开的标签:/**{@hide}*/;再者可以在修改后执行:make update-api(公开),将修改内容与API的doc文件更新到一致。

2.2解决办法:
1>执行: make update -api ;
2>修改后相应API文件后,在base库下面会产生“.current.txt”文件的差异,提交时将该差异一并提交审核即可。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值