Ubuntu16.04编译Android 4.4 (Nexus5)

博客参考相关链接介绍构建Android KitKat Nexus 5时遇到的问题及解决办法。包括jdk使用1.6并设置环境变量,Can’t use ‘defined(@array)’问题参考特定博客解决,Make版本问题有完整修改diff文件,还给出了其他相关链接。

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

参考:https://nosemaj.org/howto-build-android-kitkat-nexus-5

repo init \
    -u git://github.com/jamesonwilliams/platform_manifest.git \
    -b android-4.4_r1.1
repo sync
. build/envsetup.sh
lunch aosp_hammerhead-userdebug
make clean
make updatepackage # -j10

遇到的问题有两个:
(1)jdk的问题
答案:使用1.6,并为其设置环境变量;
(2)问题:Can’t use ‘defined(@array)’ (Maybe you should just omit the defined()?) at kernel/timeconst.pl
答案:https://blog.youkuaiyun.com/wsclinux/article/details/77162244
(3)Make版本的问题
答案:直接改成4.1

完整的修改diff文件:

project build/
diff --git a/core/main.mk b/core/main.mk
index d424b25..fe947d6 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -41,7 +41,7 @@ endif
 # (Allow any version under Cygwin since we don't actually build the platform there.)
 ifeq (,$(findstring CYGWIN,$(shell uname -sm)))
 ifeq (0,$(shell expr $$(echo $(MAKE_VERSION) | sed "s/[^0-9\.].*//") = 3.81))
-ifeq (0,$(shell expr $$(echo $(MAKE_VERSION) | sed "s/[^0-9\.].*//") = 3.82))
+ifeq (0,$(shell expr $$(echo $(MAKE_VERSION) | sed "s/[^0-9\.].*//") = 4.1))
 $(warning ********************************************************************************)
 $(warning *  You are using version $(MAKE_VERSION) of make.)
 $(warning *  Android can only be built by versions 3.81 and 3.82.)

project kernel/
diff --git a/kernel/timeconst.pl b/kernel/timeconst.pl
index eb51d76..0461239 100644
--- a/kernel/timeconst.pl
+++ b/kernel/timeconst.pl
@@ -370,7 +370,7 @@ if ($hz eq '--can') {
        }
 
        @val = @{$canned_values{$hz}};
-       if (!defined(@val)) {
+       if (!@val) {
                @val = compute_values($hz);
        }
        output($hz, @val);

其他:
https://wiki.postmarketos.org/wiki/Serial_debugging

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

袁保康

你的鼓励将是我创作的最大动力

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

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

打赏作者

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

抵扣说明:

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

余额充值