2014年3月13日 星期四

[Android]android 開發基礎 (一) - make update-api

於framework裡新增public的class, method

在complier時會遇到錯誤:

==================================

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.xml by executing the following commands:
p4 edit frameworks/base/api/current.xml
make update-api
To check in the revised current.xml, you will need OWNERS
approval.

==================================

遇到這個問題可選擇以下解決方式:

1. 在新增的code裡面加上@hide

2.執行make update-api

如果不想每次都要另外執行make update-api

可到/frameworks/base/api 這個目錄找到current.txt

將執行過make update-api與伺服器上未執行過make update-api的code進行比對

就會發現執行過make update-api的current.txt 裡面新增了class或method

把新的current.txt取代伺服器上面的檔案

這樣下次從伺服器下載新的code就可以跳過make update-api這個步驟了




沒有留言: