1、按照源码中sdk目录下的howto_build_SDK.txt参考文档的编译方式
$ cd ~/my-android-git
$ . build/envsetup.sh
$ lunch sdk-eng
$ make sdk
结果,产生错误log信息如下:
#### make failed to build some targets (48 seconds) ####
2、根据一些参考资料,我解决以上相关问题采用以下步骤:
source build/envsetup
lunch em_t8370_emmc-user
source build/envsetup #需要重新source一次,我也不知道为什么,如果不重新再执行这句话,编译还是会产生像上面一样的问题。
make sdk
device/mediatek/build/build/libs/custom.mk:159: PWD = /mnt/sdb1/yangyx/MT8127_M0_MP8_0407 device/mediatek/build/build/libs/custom.mk:160: *** Can not find ProjectConfig.mk , MTK_PROJECT_CONFIGS = . Stop.
结果,产生的错误log信息如下:
Package SDK: out/host/linux-x86/sdk/em_t8370_emmc/android-sdk_1476082019_linux-x86.zip SDK: warning: including GNU target out/target/product/em_t8370_emmc/system/lib/libexif.so SDK: warning: including GNU target out/target/product/em_t8370_emmc/system/lib/libext2_blkid.so SDK: warning: including GNU target out/target/product/em_t8370_emmc/system/lib/libext2_com_err.so SDK: warning: including GNU target out/target/product/em_t8370_emmc/system/lib/libext2_e2p.so SDK: warning: including GNU target out/target/product/em_t8370_emmc/system/lib/libext2_profile.so SDK: warning: including GNU target out/target/product/em_t8370_emmc/system/lib/libext2_quota.so SDK: warning: including GNU target out/target/product/em_t8370_emmc/system/lib/libext2_uuid.so SDK: warning: including GNU target out/target/product/em_t8370_emmc/system/lib/libext2fs.so SDK: warning: including GNU target out/target/product/em_t8370_emmc/system/lib/libiprouteutil.so SDK: warning: including GNU target out/target/product/em_t8370_emmc/system/lib/libnetlink.so SDK: warning: including GNU target out/target/product/em_t8370_emmc/system/lib/libnl.so development/build/sdk.atree:49: couldn't locate source file: bin/etc1tool development/build/sdk.atree:88: couldn't locate source file: bin/split-select development/build/sdk.atree:93: couldn't locate source file: bin/bcc_compat development/build/sdk.atree:186: couldn't locate source file: framework/layoutlib.jar development/build/sdk.atree:525: couldn't locate source file: framework/layoutlib-tests.jar development/build/sdk.atree:526: couldn't locate source file: system/app/EmulatorSmokeTests/EmulatorSmokeTests.apk make: *** [out/host/linux-x86/sdk/em_t8370_emmc/android-sdk_1476082019_linux-x86.zip] Error 44
3、注释以上sdk.atress 49 88 93 186 525 526 相关的脚本
编译成功,在相关目录下生成以下的文件:
Package SDK: out/host/darwin-x86/sdk/android-sdk_eng.<build-id>_mac-x86.zip
生成的android.jar是最新的:
/out/host/linux-x86/sdk/em_t8370_emmc/android-sdk_1476083189_linux-x86/platforms/android-6.0/android.jar