温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

ubuntu编译android源码怎么排错

发布时间:2022-04-07 17:01:16 来源:亿速云 阅读:1381 作者:iii 栏目:编程语言

这篇文章主要介绍“ubuntu编译android源码怎么排错”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“ubuntu编译android源码怎么排错”文章能帮助大家解决问题。

编译源码

1、安装 openjdk8

sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-8-jdk

2  如果电脑里面存在多个java 版本,则通过如下命令选择openjdk-8即可

sudo update-alternative --config java
sudo update-alternative --config javac

2、安装依赖库

sudo apt-get install libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-dev g++-multilib
sudo apt-get install -y git flex bison gperf build-essential libncurses5-dev:i386
sudo apt-get install tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386
sudo apt-get install dpkg-dev libsdl1.2-dev libesd0-dev
sudo apt-get install git-core gnupg flex bison gperf build-essential
sudo apt-get install zip curl zlib1g-dev gcc-multilib g++-multilib
sudo apt-get install libc6-dev-i386
sudo apt-get install lib32ncurses5-dev x11proto-core-dev libx11-dev
sudo apt-get install libgl1-mesa-dev libxml2-utils xsltproc unzip m4
sudo apt-get install lib32z-dev ccache
sudo apt-get install libssl-dev

3、开始编译


/bin/bash: m4: command not found
[ 12% 12196/98404] Check module type: out/host/linux-x86/obj/STATIC_LIBRARIES/libsepol_intermediates/link_type
[ 12% 12197/98404] Export includes file:  -- out/host/linux-x86/obj/EXECUTABLES/sepolicy-analyze_intermediates/export_includes
[ 12% 12198/98404] Import includes file: out/host/linux-x86/obj/EXECUTABLES/sepolicy-analyze_intermediates/import_includes
[ 12% 12199/98404] build out/target/product/sp7731e_1h10/sp7731e-1h10-native.dtb
[ 12% 12200/98404] Notice file: system/sepolicy/NOTICE -- out/target/product/sp7731e_1h10/obj/NOTICE_FILES/src/recovery/root/sepolicy.txt
[ 12% 12201/98404] target StaticLib: libsprd_updater (out/target/product/sp7731e_1h10/obj/STATIC_LIBRARIES/libsprd_updater_intermediates/libsprd_updater.a)
[ 12% 12202/98404] Copy: out/target/product/sp7731e_1h10/kernel
ninja: build stopped: subcommand failed.
FAILED: [W][2020-11-11T18:19:35+0800][2358] void cmdline::logParams(nsjconf_t *)():250 Process will be UID/EUID=0 in the global user namespace, and will have user root-level access to files
[W][2020-11-11T18:19:35+0800][2358] void cmdline::logParams(nsjconf_t *)():260 Process will be GID/EGID=0 in the global user namespace, and will have group root-level access to files
18:19:47 ninja failed with: exit status 1

遇见这个最后的报错的时候,注意向上看看base输出。
这就是问题所在,比如我的:/bin/bash: m4: command not found
然后  下载这个指令就可以了:sudo apt-get install m4
然后重新make,继续执行就可以了。


(3)FAILED: out/target/product/fugu/obj/STATIC_LIBRARIES/libedify_intermediates/lexer.cpp
/bin/bash -c "prebuilts/misc/linux-x86/flex/flex-2.5.39 -oout/target/product/fugu/obj/STATIC_LIBRARIES/libedify_intermediates/lexer.cpp bootable/recovery/edify/lexer.ll"
flex-2.5.39: loadlocale.c:130:_nl_intern_locale_data: ?? 'cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' ???
Aborted (core dumped)
[  6% 3452/56388] //frameworks/base/libs/androidfw:libandroidfw clang++ ResourceTypes.cpp [linux]
ninja: build stopped: subcommand failed.
09:56:41 ninja failed with: exit status 1

去除所有本地化的设置&#xff0c;让命令能正确执行&#xff0c;bash 执行&#xff1a;

export LC_ALL=C

export LC_ALL=C
to your .bashrc file under your home folder


4&#xff09;error: ro.build.fingerprint cannot exceed 91 bytes
更改 build/tools/post_process_props.py 文件行 PROP_VALUE_MAX = 91 为 PROP_VALUE_MAX = 128

    #### PROP_VALUE_MAX = 91
    PROP_VALUE_MAX = 128
更改 bionic/libc/include/sys/system_properties.h 文件行 #define PROP_VALUE_MAX  91 为 #define PROP_VALUE_MAX  128
    #### #define PROP_VALUE_MAX  91
    #define PROP_VALUE_MAX  128
更改 frameworks/native/cmds/installd/installd_deps.h 文件行 constexpr size_t kPropertyValueMax = 91u; 为 constexpr size_t kPropertyValueMax = 128u;
    #### constexpr size_t kPropertyValueMax = 91u;
    constexpr size_t kPropertyValueMax = 128u;

关于“ubuntu编译android源码怎么排错”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识,可以关注亿速云行业资讯频道,小编每天都会为大家更新不同的知识点。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI