溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

ubuntu編譯android源碼怎么排錯

發(fā)布時間:2022-04-07 17:01:16 來源:億速云 閱讀:1380 作者:iii 欄目:編程語言

這篇文章主要介紹“ubuntu編譯android源碼怎么排錯”的相關(guān)知識,小編通過實(shí)際案例向大家展示操作過程,操作方法簡單快捷,實(shí)用性強(qiáng),希望這篇“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,繼續(xù)執(zhí)行就可以了。


(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

去除所有本地化的設(shè)置&#xff0c;讓命令能正確執(zhí)行&#xff0c;bash 執(zhí)行&#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;

關(guān)于“ubuntu編譯android源碼怎么排錯”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識,可以關(guān)注億速云行業(yè)資訊頻道,小編每天都會為大家更新不同的知識點(diǎn)。

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI