android 编译SDK

在做一个MTK的系统项目中,为了方便开发,需要编译一下SDK,现记录一下编译SDK遇到的问题

1.source build/envsetup.sh
2.lunch [product_name]
3. source build/envsetup.sh
4.make sdk
注意,第三步如果缺失,会报错

device/mediatek/build/build/libs/custom.mk:160: *** Can not find ProjectConfig.mk , MTK_PROJECT_CONFIGS = .  Stop. 

进行上面4步后,还是编译失败,但是在out\target\common\obj\PACKAGING\android_jar_intermediates目录下已经生成了android.jar,如果只需要这个jar的话,就算完成了。
编译失败的错误是关于生成Intent.aidl无规则对应:frameworks/core/java/android/content/Intent.aidl,在frameworks里Intent.aidl的路径其实是在frameworks/base/core/java/android/content/Intent.aidl,所以猜测是哪个地方配置错误,经过一番寻找,找到在
vendor\haocheng\proprietary\frameworks\core\java\android\content\Intent.aidl中存在这个文件,
在Y:\mt6735\vendor\haocheng\proprietary\frameworks\Android.mk中注释掉

# ============================================================
# aidl_files := \
#   $(HCT_TOPDIR)/frameworks/core/java/com/hct/android/content/Intent.aidl

# gen := $(TARGET_OUT_COMMON_INTERMEDIATES)/com.hct.framework.aidl
# $(gen): PRIVATE_SRC_FILES := $(aidl_files)
# vALL_SDK_FILES += $(gen)
# $(gen): $(aidl_files) | $(AIDL)
    #   @echo Aidl Preprocess: $@
    #   $(hide) $(AIDL) --preprocess $@ $(PRIVATE_SRC_FILES)

# the documentation
# ============================================================

然后又报有重复的类ConfigBuildFlags.java
然后又删掉
vendor\haocheng\proprietary\frameworks\core\config下的debug和nodubug目录,只留下sdk目录
再以后
vendor/haocheng/proprietary/frameworks/core/res/res/values /public.xml解析失败,看了一下是第一行有空行,挨个把values的目录的所有xml检测一遍,都删掉第一行的空行,
再编译,又报out目录下的Lohit-Odia.ttf版本错误,于是又修改了 frameworks/base/tools/layoutlib/rename_font/build_font_sin gle.py中的get_version方法,改完如下:

def get_version(string):
  # The string must begin with 'Version n.nn '
  # to extract n.nn, we return the second entry in the split strings.
  string = string.strip()

  if not string.startswith('Version '):
    print string + ' is not a valid font'
     #raise InvalidFontException('mal-formed font version')
    return sanitize(string)
  return sanitize(string.split()[1])

再编译,又报

development/build/sdk.atree:49: couldn't locate source file: bin/etc1tool

就去development/build/sdk.atree中,把对应的行号的代码注释掉,
终于编译成功了
在mt6735\out\host\linux-x86\sdk\full_hct6735_35gc_l1目录下出现了android-sdk_1488448733_linux-x86.zip和android-sdk_1488448733_linux-x86文件夹,里面就是SDK了

你可能感兴趣的:(安卓,android,sdk,mtk)