在eclipse ADT环境下,drawable-hdpi/mdpi/ldmpi等drawable文件会被自动编译到.apk文件里,但是在Source Tree下编译的时候,因编译环境的不同,系统可能并不会将所有drawable-*文件全部编译到.apk文件里,这时,我们就不得不修改系统编译环境。
方法1.在编译时直接加上参数 $ make CUSTOM_LOCALES="hdpi mdpi ldpi"
方法2.在androidsrc/build/buildspc.mk.default 中进行如下修改
# Choose additional locales, like "en_US" or "it_IT", to add to any
# built product. Any locales that appear in CUSTOM_LOCALES but not in
# the locale list for the selected product will be added to the end
# of PRODUCT_LOCALES.
ifndef CUSTOM_LOCALES
CUSTOM_LOCALES:=hdpi mdpi ldpi
endif
修改完后将文件build.mk.default复制到androidsrc目录下并将其重命名为build.mk。