編譯環(huán)境:Ubuntu 16.0.4 open jdk7
問(wèn)題一:
/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: ***正在等待未完成的任務(wù)....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
問(wèn)題二:
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 錯(cuò)誤分析:錯(cuò)誤信息表明是由于API錯(cuò)誤導(dǎo)致,進(jìn)一步研究發(fā)現(xiàn):谷歌對(duì)于所有的類和API操骡,分為開方和非開放兩種,而開放的類和API瓷炮,可以通過(guò)“Javadoc標(biāo)簽”與源碼同步生成“程序的開發(fā)文檔”肩刃;當(dāng)我們修改或者添加一個(gè)新的API時(shí)豁护,我們有兩種方案可以避免出現(xiàn)上述錯(cuò)誤,其一是將該接口加上 非公開的標(biāo)簽:/**{@hide}*/褒翰;再者可以在修改后執(zhí)行:make update-api(公開)贮懈,將修改內(nèi)容與API的doc文件更新到一致。
2.2 解決辦法:
步驟1:執(zhí)行: make update -api ;
步驟2:修改后相應(yīng)API文件后优训,在base庫(kù)下面會(huì)產(chǎn)生“.current.txt”文件的差異朵你,提交時(shí)將該差異一并提交審核即可。