android 编译错误汇总

本文记录了在Android系统编译过程中遇到的四个典型错误及解决方案,包括stk.apk和gralloc.msm7k.so的正确编译配置、解决msm7625编译错误以及修复jsilver模块编译问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.错误:目的编译stk.apk进system.img..

解决: 在PRODUCT_PACKAGES := stk后,编译后发现 system.img 没有stk.apk。后细心比较后发现编译系统是区分大小写的,改stk--->Stk后编译进去了。 ----2011.12.14

 

2.错误:目的编译gralloc.msm7k.so。

解决:但加装位置不对,以致没有编译进system.img..PRODUCT_PACKAGES := gralloc.msm7k原本放在BoardConfig.mk,没有成功。改放在mmk.mk中后成功了(产品名为mmk).--------2011.12.14


3.错误:目的能够编译msm7625..

错误提示:

build/core/base_rules.mk:74: *** Module name: msm7k...
build/core/base_rules.mk:75: *** Makefile location:
              .
              .
              .
build/core/base_rules.mk:98: *** user tag detected on new module - user tags
are only supported on legacy modules.  Stop.
解决:原码中缺少对armv6j支持。主要是build/core/combo/arch/arm --少了armv6j.mk;dalvik/vm下也有几个与armv6j相关的文件缺失。从其它原码copy过来,重新编译就可以解决


4. 遇到错误:

build/core/base_rules.mk:78: *** Module name: jsilver
build
/core/base_rules.mk:79: *** Makefile location: external/jsilver
build
/core/base_rules.mk:80: *
build
/core/base_rules.mk:81: * Each module must use a LOCAL_MODULE_TAGS in its
build
/core/base_rules.mk:82: * Android.mk. Possible tags declared by a module:
build
/core/base_rules.mk:83: *
build
/core/base_rules.mk:84: *     optional, debug, eng, tests, samples
build
/core/base_rules.mk:85: *
build
/core/base_rules.mk:86: * If the module is expected to be in all builds
build
/core/base_rules.mk:87: * of a product, then it should use the
build
/core/base_rules.mk:88: * "optional" tag:
build
/core/base_rules.mk:89: *
build
/core/base_rules.mk:90: *    Add "LOCAL_MODULE_TAGS := optional" in the
build
/core/base_rules.mk:91: *    Android.mk for the affected module, and add
build
/core/base_rules.mk:92: *    the LOCAL_MODULE value for that component
build
/core/base_rules.mk:93: *    into the PRODUCT_PACKAGES section of product
build
/core/base_rules.mk:94: *    makefile(s) where it's necessary, if
build
/core/base_rules.mk:95: *    appropriate.
build
/core/base_rules.mk:96: *
build
/core/base_rules.mk:97: * If the component should be in EVERY build of ALL
build
/core/base_rules.mk:98: * products, then add its LOCAL_MODULE value to the
build
/core/base_rules.mk:99: * PRODUCT_PACKAGES section of
build
/core/base_rules.mk:100: * build/target/product/core.mk
build
/core/base_rules.mk:101: *
build
/core/base_rules.mk:102: *** user tag detected on new module - user tags are only supported on legacy modules.  Stop.

This is due to the declaration of LOCAL_MODULE_TAGS. To fix it just follow the instructions that suggest including the optional tag. Thanks to [10] for the command line that replace user tag by optional tag on every affected file.

用这个命令行将所有user改成optional即可:

find ./ -exec grep -l "LOCAL_MODULE_TAGS := user" {} \; -exec sed -i.bak s/"LOCAL_MODULE_TAGS := user"/"LOCAL_MODULE_TAGS := optional"/g {} \;


             


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值