編譯環境:Ubuntu 16.0.4 open jdk7
問題一:
/home/pngcui/MSD6A828/l-828-0513/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/bin/../lib/gcc/x86_64-linux/4.6/../../../../x86_64-linux/bin/ld: error:out/host/linux-x86/obj32/STATIC_LIBRARIES/libcompiler_rt_intermediates/libcompiler_rt.a(eprintf.o): unsupported reloc43againstglobalsymbol stderr2external/compiler-rt/lib/builtins/eprintf.c:32: error: unsupported reloc433collect2: ld returned1exit status4build/core/host_shared_library_internal.mk:44: recipefortarget'out/host/linux-x86/obj32/lib/libcompiler_rt.so'failed5make: *** [out/host/linux-x86/obj32/lib/libcompiler_rt.so] Error16make: ***正在等待未完成的任務....7host C++: dalvikvm_32 <= art/dalvikvm/dalvikvm.cc89#### make failed to build some targets (01:27:58(hh:mm:ss)) ####
解決辦法:
步驟1:找到下載源碼里的art/build/Android.common_build.mk
# Host.
ART_HOST_CLANG := false
ifneq ($(WITHOUT_HOST_CLANG),false) (修改處:將true改為false)ture--->false
# By default, host builds use clang for better warnings.
ART_HOST_CLANG := ture
endif
步驟2:直接輸入命令:ln -sf /usr/bin/ld.gold prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/x86_64-linux/bin/ld
問題二:
out/target/common/obj/PACKAGING/public_api.txt:20: error 5: Added public field android.Manifest.permission.BACKUP
out/target/common/obj/PACKAGING/public_api.txt:81: error 5: Added public field android.Manifest.permission.INVOKE_CARRIER_SETUP
out/target/common/obj/PACKAGING/public_api.txt:105: error 5: Added public field android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
out/target/common/obj/PACKAGING/public_api.txt:115: error 5: Added public field android.Manifest.permission.RECEIVE_EMERGENCY_BROADCAST
******************************
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.1 錯誤分析:錯誤信息表明是由于API錯誤導致,進一步研究發現:谷歌對于所有的類和API,分為開方和非開放兩種,而開放的類和API,可以通過“Javadoc標簽”與源碼同步生成“程序的開發文檔”;當我們修改或者添加一個新的API時,我們有兩種方案可以避免出現上述錯誤,其一是將該接口加上 非公開的標簽:/**{@hide}*/;再者可以在修改后執行:make update-api(公開),將修改內容與API的doc文件更新到一致。
2.2 解決辦法:
步驟1:執行: make update -api ;
步驟2:修改后相應API文件后,在base庫下面會產生“.current.txt”文件的差異,提交時將該差異一并提交審核即可。