当前位置: 首页 > article >正文

AOSP编译问题

问题:未安装rsync

/bin/bash: line 1: rsync: command not found

解决:安装rsync

sudo pacman -S rsync

问题:默认情况在linux编译系统 会开启odex的。

Fault message: Check failed: map.IsValid() Failed anonymous mmap((nil), 131072, 0x3, 0x22, -1, 0): Cannot allocate memory. See process maps in the log.
ERROR: Dex2oat failed to compile a boot image.It is likely that the boot classpath is inconsistent.Rebuild with ART_BOOT_IMAGE_EXTRA_ARGS="--runtime-arg -verbose:verifier" to see verification errors.
04:07:58 ninja failed with: exit status 1

#### failed to build some targets (13:29 (mm:ss)) ####

解决:编译前关闭dex2oat

export WITH_DEXPREOPT=false

问题:mke2fs参数导致

Creating regular file /data/aosp/out/soong/.temp/tmptQHrWf/content/apex_payload.img
Invalid filesystem option set: has_journal,extent,huge_file,flex_bg,metadata_csum,metadata_csum_seed,64bit,dir_nlink,extra_isize,orphan_file

AssertionError: Failed to execute: out/soong/host/linux-x86/bin/mke2fs -O ^has_journal -b 4096 -m 0 -t ext4 -I 256 -N 162 -U 7d1522e1-9dfa-5edb-a43e-98e3a4d20250 -E hash_seed=7d1522e1-9dfa-5edb-a43e-98e3a4d20250 /data/aosp/out/soong/.temp/tmptQHrWf/content/apex_payload.img 163M

解决:修改mke2fs的配置文件。

cp  /etc/mke2fs.conf /etc/mke2fs.conf.bak #备份
vim /etc/mke2fs.conf # 修改

将下面部分
ext4 = {
features = has_journal,extent,huge_file,flex_bg,metadata_csum,metadata_csum_seed,64bit,dir_nlink,extra_isize,orphan_file
}

修改为
ext4 = {
features = has_journal
}

后记:
开始以为是磁盘的xfs格式导致,后来利用Create a File Image Container or Filesystem in a File的方法测试后发现不是磁盘格式问题

测试步骤:用mke2fs制作img镜像文件

truncate --size=100M myfs.img
dd if=/dev/zero of=myfs.img count=204800
sudo mkfs.ext4 myfs.img
sudo mke2fs -t ext4 myfs.img

问题:python版本不匹配

FAILED: out/target/product/generic_x86_64/system-qemu.img
/bin/bash -c "(export SGDISK=out/host/linux-x86/bin/sgdisk SIMG2IMG=out/host/linux-x86/bin/simg2img;      device/generic/goldfish/tools/mk_combined_img.py -i out/target/product/generic_x86_64/system-qemu-config.txt -o out/target/product/generic_x86_64/system-qemu.img)"
  File "/data/aosp/device/generic/goldfish/tools/mk_combined_img.py", line 48
    print "'%s' cannot be converted to int" % (line[2])
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
10:17:24 ninja failed with: exit status 1

解决:修改python为python2

sudo pacman -S python2 # 安装python2
sudo ln -sb /usr/bin/python2 /usr/bin/python # 新建软链接,备份旧链接

问题:编译期间改变了out目录导致报错

emulator: WARNING: Couldn't find crash service executable /data/aosp/prebuilts/android-emulator/linux-x86_64/emulator64-crash-service

emulator: ERROR: No initial system image for this configuration!

解决:使用emulator -verbose查看详细报错信息,发现是由于使用export OUT_DIR=xx改变了目录,导致目录错乱。
使用evn查看当前环境变量,修改不正确的目录,例如下面,具体要看情况

export ANDROID_HOST_OUT=/data/aosp/out/host/linux-x86
export ANDROID_PRODUCT_OUT=/data/aosp/out/target/product/generic_x86_64
export ANDROID_HOST_OUT_TESTCASES=/data/aosp/out/host/linux-x86/testcases

问题:aidegen命令python版本不兼容

$ aidegen Settings -i s
 
MutableMapping = collections.MutableMapping
AttributeError: module 'collections' has no attribute 'MutableMapping'

解决:由于arch linux当前python版本是python3.10,从 python3.3开始,就使用 from collections.abc import MutableMapping 替代 from collections import Mapping, MutableMapping;
在 python3.10 上,彻底移除了 from collections import Mapping, MutableMapping。

yay -S python38 # 安装python3.8版本
ln -s /usr/bin/python3.8 /usr/bin/python3 #将python3指向python3.8

http://www.kler.cn/news/16291.html

相关文章:

  • 【Bus】编写一个Demo虚拟的总线-设备-驱动模型
  • 电话号码的字母组合
  • 荔枝派Zero(全志V3S)基于QT实现在LCD显示图片
  • 【五一创作】Scratch资料袋
  • 使用邻接矩阵实现有向图最短路径Dijkstra算法 题目编号:1136
  • 32岁阿里P7,把简历改成不知名小公司,学历改成普通本科,工作内容不变,投简历全挂!...
  • 什么是跨域?
  • 谈谈常用Reverse shell,以及他们是怎么做到的。
  • linux下的权限管理
  • gl-opendrive插件(车俩3D仿真模拟自动驾驶)
  • MATLAB | 如何使用MATLAB绘制高度自定义的桑基图(sankey)
  • 废物,我TMD一个985却斗不过专科生(大厂自动化测试2年被裁)
  • Java使用 Scanner连续输入int, String 异常错误输出原因分析
  • 轻叶H5营销单页,让你的营销更加清爽高效
  • 实训笔记1
  • 15-4-线程-线程同步之互斥量加锁解锁
  • matlab绘制折线图基本操作
  • 『python爬虫』04. 爬虫需要知道的HTTP协议知识(保姆级图文)
  • 云和恩墨荣获2023数字中国创新大赛·信创赛道“最具发展潜力奖”等4个奖项
  • C语言从入门到精通第16天(指针的定义与基本使用)
  • PID控制---基于python模拟
  • 面向画布(Canvas)的JavaScript库
  • 【c语言小项目】基于easyX的俄罗斯方块
  • Analysis For Office的一些使用技巧
  • C++练级之初级:第六篇
  • 使用PyTorch和Flower 进行联邦学习
  • 重载new和delete
  • Flutter集成个推推送-安卓原生篇
  • 【电商必学】 WhatsApp 全新攻略:什么是交互式消息模板
  • 【Zookeeper源码走读】第一章 客户端与服务器的连接过程