Ubuntu18编译Android10源代码

Ubuntu18编译Android10源代码

Ubuntu18编译Android10源代码

QQ1274807709、QQ3619049616
机型:piexl/Vmware虚拟机


前言

仅个人环境编译测试,部分版本对应的版本BUG很多,不做多排除BUG


一、链接引用

https://source.android.com/source/requirements.html #安卓各版本源码编译要求
https://source.android.com/source/build-numbers.html #代号和细分版本号
https://source.android.com/source/initializing.html #搭建编译环境
https://mirrors.tuna.tsinghua.edu.cn/help/AOSP/ #下载源代码(清华大学开源软件镜像站)
https://source.android.com/setup/build/building #准备编译
https://source.android.com/setup/building-kernels #编译内核
https://source.android.com/source/running.html #谷歌手机刷机教程
http://download.lineageos.org.cn/ #LineageOS 镜像下载
http://androidxref.com/ #安卓源码阅读在线版
https://msdn.itellyou.cn/ #Windows系统
http://mirrors.aliyun.com/ubuntu-releases/ #Ubuntu阿里云镜像
https://developers.google.com/android/images #谷歌手机工厂镜像
https://developers.google.com/android/drivers #谷歌手机驱动下载
https://android.googlesource.com/ #安卓开放源代码项目

个人整理

细分版本 			分支版本 			版本代号	         支持的设备
KTU84P			android-4.4.4_r1	    KitKat		      Nexus 45
LMY48M			android-5.1.1_r14	    Lollipop		  Nexus 45
MMB29V			android-6.0.1_r17	    Marshmallow	      Nexus 55X、6P
N2G47O			android-7.1.2_r8	    Nougat		      Nexus 5X、6P、Pixel
opm1.171019.011	android-8.1.0_r1
pq2a.190405.003	android-9.0.0_r35

#VM虚拟机复制BUG解决

虚拟机可能会造成VMTools无法使用,可以使用命令进行恢复:
sudo apt-get autoremove open-vm-tools
sudo apt-get install open-vm-tools
sudo apt-get install open-vm-tools-desktop

#Python版本BUG解决:默认可能是2.7.x版本,要换成3.5x

sudo apt install python3       
sudo apt install python        
sudo apt install python-minimal
python -> /etc/alternatives/python*
update-alternatives: using /usr/bin/python3.6 to provide /usr/bin/python (python) in auto mode

二、使用步骤

1.获取源代码

sudo apt-get update
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip
git config --global user.name "a1274807709"
git config --global user.email "1274807709@qq.com"
chmod 777 repo
mkdir -p Android10.0.0_r5
cd Android10.0.0_r5
repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest
repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-10.0.0_r5
repo sync --no-clone-bundle

三、存在的报错解决

FAILED: out/target/product/generic_x86/obj/RENDERSCRIPT_BITCODE/libclcore.bc_intermediates/rs_matrix.bc
/bin/bash -c “PWD=/proc/self/cwd prebuilts/clang/host/linux-x86/clang-3289846/bin/clang -Iframeworks/rs/script_api/include -Iexternal/clang/lib/Headers -MD -DRS_VERSION=24 -std=c99 -c -O3 -fno-builtin -e
mit-llvm -target renderscript32-linux-androideabi -fsigned-char -D__i386__ -Wno-deprecated -Werror -Werror -Wall -Wextra -Iframeworks/rs/cpu_ref -DRS_DECLARE_EXPIRED_APIS -x renderscript frameworks/rs/
driver/runtime/rs_matrix.c -o out/target/product/generic_x86/obj/RENDERSCRIPT_BITCODE/libclcore.bc_intermediates/rs_matrix.bc”
prebuilts/clang/host/linux-x86/clang-3289846/bin/clang.real: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory

命令

sudo apt install libncurses5
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值