解决fatal error: sys/system_properties.h: No such file or directory compilation terminated.

编译的异常log:

system/core/include/cutils/properties.h:22:35: fatal error: sys/system_properties.h: No such file or directory
compilation terminated.
make[1]: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libinput_intermediates/<strong>xxxxx</strong>.o] 错误 1
make[1]:正在离开目录 `/home/<strong>xxxx</strong>/code/<strong>xxxxx</strong>/kk/bra_<strong>xxxx</strong>/alps'
                    ==> [FAIL]  2015/03/20 17:16:54
make: *** [mm] 错误 2

分析:

编译不过是由于BUILD_HOST_STATIC_LIBRARY没有引用相应的静态库,在mk文件引用相应静态库,编译通过。

修改Android.mk文件:

LOCAL_MODULE_TAGS := optional
LOCAL_STATIC_LIBRARIES := \
    libcutils \

include $(BUILD_HOST_STATIC_LIBRARY)

如果找不到对应模块的mk文件可用下面这条命令尝试搜索:

//下面的xxxx.cpp可以使编译模块中的文件,最好是你修改之后的文件

find -name *.mk | xargs grep "xxxx.cpp" -nsr --color=auto

注!上面xxxx为了避免敏感信息而用xxxx来代替。本人对于编译脚本和底层并不是很熟悉,因此对这个解决过程比较痛苦,所以留下这篇博客与遇到此类问题的朋友共勉,也希望大家能够理解这种分享的精神。

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

高桐@BILL

分享快乐,快乐分享...

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值