解决android编译出现"frameworks/base/api/17.txt:21071: error 9: Removed public method android.telephony.gsm.SmsManager.divideMessage..."错误的方法

  最近安装了JAVA7,在编译android 4.2系统时出现错误:

Compiling SDK Stubs: out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/classes.jar
frameworks/base/api/17.txt:21071: error 9: Removed public method android.telephony.gsm.SmsManager.divideMessage
frameworks/base/api/17.txt:21072: error 9: Removed public method android.telephony.gsm.SmsManager.getDefault
frameworks/base/api/17.txt:21073: error 9: Removed public method android.telephony.gsm.SmsManager.sendDataMessage
frameworks/base/api/17.txt:21074: error 9: Removed public method android.telephony.gsm.SmsManager.sendMultipartTextMessage
frameworks/base/api/17.txt:21075: error 9: Removed public method android.telephony.gsm.SmsManager.sendTextMessage
frameworks/base/api/17.txt:21076: error 10: Removed field android.telephony.gsm.SmsManager.RESULT_ERROR_GENERIC_FAILURE
frameworks/base/api/17.txt:21077: error 10: Removed field android.telephony.gsm.SmsManager.RESULT_ERROR_NO_SERVICE
frameworks/base/api/17.txt:21078: error 10: Removed field android.telephony.gsm.SmsManager.RESULT_ERROR_NULL_PDU
frameworks/base/api/17.txt:21079: error 10: Removed field android.telephony.gsm.SmsManager.RESULT_ERROR_RADIO_OFF
frameworks/base/api/17.txt:21080: error 10: Removed field android.telephony.gsm.SmsManager.STATUS_ON_SIM_FREE
frameworks/base/api/17.txt:21081: error 10: Removed field android.telephony.gsm.SmsManager.STATUS_ON_SIM_READ
frameworks/base/api/17.txt:21082: error 10: Removed field android.telephony.gsm.SmsManager.STATUS_ON_SIM_SENT
frameworks/base/api/17.txt:21083: error 10: Removed field android.telephony.gsm.SmsManager.STATUS_ON_SIM_UNREAD
frameworks/base/api/17.txt:21084: error 10: Removed field android.telephony.gsm.SmsManager.STATUS_ON_SIM_UNSENT

 

原因是新版的javadoc处理出错.

查看/out/target/common/obj/JAVA_LIBRARIES/api-stubs_intermediates/droiddoc-src-list文件,里面对frameworks/opt/telephony/src/java/android/telephony/gsm里的文件都包含了二次.

所以在将这个文件送到javadoc前,可以将重复的文件名删除,即可解决这个问题.

 

修改build/core/droiddoc.mk.在161行和193行后增加

head -1 $(PRIVATE_SRC_LIST_FILE) | tr " " "\n" | sort | uniq | tr "\n" " " > $(PRIVATE_SRC_LIST_FILE)_temp; \
cat $(PRIVATE_SRC_LIST_FILE) | sed '1 d' >> $(PRIVATE_SRC_LIST_FILE)_temp; \
mv $(PRIVATE_SRC_LIST_FILE)_temp $(PRIVATE_SRC_LIST_FILE); \

再编译就可通过.

 

posted on 2013-05-07 12:12  Justin_Wu  阅读(1502)  评论(0)    收藏  举报

导航