Android can only be built by versions 3.81 and 3.82

本文介绍了解决在新系统中使用较高版本make编译Android源码时遇到的问题。提供了两种解决方案:一是更换为make3.2版本;二是修改aosp_root/build/core/main.mk文件中的make版本检查逻辑,允许make4.1版本通过。

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

在新系统中编译老版本的android source 时出现的这个问题。

解决

方法1:

    remove 掉现在的make, 编译安装make 3.2

 

方法2:

   编辑aosp_root/build/core/main.mk

 40 # Check for broken versions of make.
 41 # (Allow any version under Cygwin since we don't actually build the platform there.)
 42 ifeq (,$(findstring CYGWIN,$(shell uname -sm)))
 43 ifeq (0,$(shell expr $$(echo $(MAKE_VERSION) | sed "s/[^0-9\.].*//") = 3.81))
 44 ifeq (0,$(shell expr $$(echo $(MAKE_VERSION) | sed "s/[^0-9\.].*//") = 3.82))
 45 ifeq (0,$(shell expr $$(echo $(MAKE_VERSION) | sed "s/[^0-9\.].*//") = 4.1))          #<----------------------在这里让make4.1可以编译
 46 $(warning ********************************************************************************)
 47 $(warning *  You are using version $(MAKE_VERSION) of make.)
 48 $(warning *  Android can only be built by versions 3.81 and 3.82.)
 49 $(warning *  see https://source.android.com/source/download.html)
 50 $(warning ********************************************************************************)
 51 $(error stopping)
 52 endif
 53 endif
 54 endif
 55 endif                                                                                                                          #<------------------------补完ifeq
  因为人家分析make 4.1 和3.8区别不大。

转载于:https://www.cnblogs.com/blowing-in-the-wind/p/5960375.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值