Android PRODUCT_COPY_FILES导致的编译错误

昨天研究Android的Makefile,想要实现拷贝文件功能。上网查资料,查到了可以用PRODUCT_COPY_FILES这个来弄,然后就照着网上的方法这样搞了一把。结果发现还是不行,而且把之前的PRODUCT_COPY_FILES给改动了,还知道怎么还原。这下可好,想要再编译整个ics,就一直给我报错。

The following variables have been changed: PRODUCT_COPY_FILES. Stop然后我就一直编译不过去了。

上网查了半天,有说这样改的:

修改方法:改两处1)build/core/Makefile: 

 

 

error改成warning

 

2)build/core/product.mk

一样,error改成warning (原文:http://blog.csdn.net/xunian123/article/details/7758724)

我发现改了之后,虽然之前报错的地方能编过( 当然能编过啦,因为都只是warning了。。。),但是由于没有解决根本问题,导致编译到后面还是会出错。

继续google,发现了很多问题,但是好多网友都是单独编译某个模块没有完全编译,虽然报错一样,但是性质不一样,大多是没有加"include $(BUILD_PREBUILT)"导致的。

没办法,只能继续从错误信息分析,跟踪报错的mk文件,查到build/core/product.mk,可以看到是由于_product_stash_var_list变量被我之前的PRODUCT_COPY_FILES这个操作误改了。

  1. 251 # Assert that the the variable stashed by stash-product-vars remains untouched.  
  2. 252 # $(1): The prefix as supplied to stash-product-vars  
  3. 253 #  
  4. 254 define assert-product-vars  
  5. 255 $(strip \  
  6. 256   $(eval changed_variables:=)  
  7. 257   $(foreach v,$(_product_stash_var_list), \  
  8. 258     $(if $(call streq,$($(v)),$($(strip $(1))_$(call rot13,$(v)))),, \  
  9. 259         $(eval $(warning $(v) has been modified: $($(v)))) \  
  10. 260         $(eval $(warning previous value: $($(strip $(1))_$(call rot13,$(v))))) \  
  11. 261         $(eval changed_variables := $(changed_variables) $(v))) \  
  12. 262    ) \  
  13. 263   $(if $(changed_variables),\  
  14. 264     $(eval $(error The following variables have been changed: $(changed_variables))),)  
  15. 265 )  
  16. 266 endef  
251 # Assert that the the variable stashed by stash-product-vars remains untouched.
252 # $(1): The prefix as supplied to stash-product-vars
253 #
254 define assert-product-vars
255 $(strip \
256   $(eval changed_variables:=)
257   $(foreach v,$(_product_stash_var_list), \
258     $(if $(call streq,$($(v)),$($(strip $(1))_$(call rot13,$(v)))),, \
259         $(eval $(warning $(v) has been modified: $($(v)))) \
260         $(eval $(warning previous value: $($(strip $(1))_$(call rot13,$(v))))) \
261         $(eval changed_variables := $(changed_variables) $(v))) \
262    ) \
263   $(if $(changed_variables),\
264     $(eval $(error The following variables have been changed: $(changed_variables))),)
265 )
266 endef
要怎么还原这个变量呢?我试了重新打开终端source 环境变量、lunch product,发现还是不行。又make clean想重编,发现还是不行。。。。

后来再一想,要不然我先lunch个别的product ,说不定会覆盖我目前的PRODUCT_COPY_FILES这个变量,重赋初值,我再lunche回来,是不是就可以了?

于是就试了试,lunch full,编了一下,报错了;再lunch 12(我的prodcut),再重新编译,OK,过了。。。尼玛- -

至于找到根本原因,还需要再仔细研究下。如果有大神知晓的,也求指导~

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值