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

Android 之永乐大典

DexOpt

Android DexOpt前世今生:参考https://blog.csdn.net/dengtonglong/article/details/140828809

1 dex_preopt_check导致编译报错

问题背景

高通T项目,更新google mainline到6月份,编译nogms版本出现如下异常

报错日志

[2024-12-14T10:08:45.533Z] build/make/core/tasks/dex_preopt_check.mk:13: warning:  Missing compilation artifacts. Dexpreopting is not working for some system server jars 
[2024-12-14T10:08:45.533Z] Offending entries:
[2024-12-14T10:08:45.533Z] system/framework/oat/arm64/apex@com.android.adservices@javalib@service-adservices.jar@classes.odex
[2024-12-14T10:08:45.534Z] system/framework/oat/arm64/apex@com.android.adservices@javalib@service-adservices.jar@classes.vdex
[2024-12-14T10:08:45.534Z] system/framework/oat/arm64/apex@com.android.adservices@javalib@service-sdksandbox.jar@classes.odex
[2024-12-14T10:08:45.534Z] system/framework/oat/arm64/apex@com.android.adservices@javalib@service-sdksandbox.jar@classes.vdex
[2024-12-14T10:08:45.534Z] system/framework/oat/arm64/apex@com.android.appsearch@javalib@service-appsearch.jar@classes.odex
[2024-12-14T10:08:45.534Z] system/framework/oat/arm64/apex@com.android.appsearch@javalib@service-appsearch.jar@classes.vdex
[2024-12-14T10:08:45.534Z] system/framework/oat/arm64/apex@com.android.media@javalib@service-media-s.jar@classes.odex
[2024-12-14T10:08:45.534Z] system/framework/oat/arm64/apex@com.android.media@javalib@service-media-s.jar@classes.vdex
[2024-12-14T10:08:45.534Z] system/framework/oat/arm64/apex@com.android.os.statsd@javalib@service-statsd.jar@classes.odex
[2024-12-14T10:08:45.534Z] system/framework/oat/arm64/apex@com.android.os.statsd@javalib@service-statsd.jar@classes.vdex
[2024-12-14T10:08:45.534Z] system/framework/oat/arm64/apex@com.android.tethering@javalib@service-connectivity.jar@classes.odex
[2024-12-14T10:08:45.534Z] system/framework/oat/arm64/apex@com.android.tethering@javalib@service-connectivity.jar@classes.vdex
[2024-12-14T10:08:45.534Z] In file included from build/make/core/main.mk:1479:
[2024-12-14T10:08:45.534Z] In file included from build/make/core/Makefile:6977:
[2024-12-14T10:08:45.534Z] build/make/core/tasks/dex_preopt_check.mk:13: error: Build failed.
[2024-12-14T10:08:45.534Z] 18:08:45 ckati failed with: exit status 1

问题分析

如下编译脚本逻辑,这里通过DISABLE_DEXPREORT_CHECK宏控来失能是否进行DEXPREOPT优化检测,如果为true则失能,默认需要进行优化检测,通过过滤所有PRODUCT_PACKAGES安装的应用,即先过滤ALL_DEFAULT_INSTALLED_MODULES宏控指定列表里面的应用,然后在过滤DEXPREOPT_SYSTEMSERVER_ARTIFACTS列表中指定的需要dexpreort优化的系统jar。

/system/build/make/core/tasks/dex_preopt_check.mk
# Checks that some critical dexpreopt output files are installed.
# Inputs:
# DISABLE_DEXPREOPT_CHECK: True if the check should be disabled.
# PRODUCT_PACKAGES: The list of packages to be installed for the product.
# ALL_DEFAULT_INSTALLED_MODULES: The full list of modules going to be installed.
# DEXPREOPT_SYSTEMSERVER_ARTIFACTS: The list of compilation artifacts of system server jars, which
# 	is generated by Soong in dexpreopt_check.go.
ifneq (true,$(DISABLE_DEXPREOPT_CHECK))
  # Skip the check if the system server is not installed for the product.
  ifneq (,$(filter services,$(PRODUCT_PACKAGES)))
    $(call maybe-print-list-and-error,\
      $(filter-out $(ALL_DEFAULT_INSTALLED_MODULES),$(DEXPREOPT_SYSTEMSERVER_ARTIFACTS)),\
      Missing compilation artifacts. Dexpreopting is not working for some system server jars \
    )
  endif
endif

出现上面报错可能的原因,google官方网站已经介绍:

搜索systemserverclasspath_fragment可以看到mainline多个模块都配置了优化

解决方案

  • 配置DISABLE_DEXPREORT_CHECK = true使能dexpreopt检查,但是一般不建议
  • 取消systemserverclasspath_fragment相关配置,但是针对系统应用一般也不建议,这里的问题为apks本身的问题,更新mainline解决

http://www.kler.cn/a/442679.html

相关文章:

  • 2025年中科院分区大类划分公布!新增8155本
  • 源码安装httpd2.4
  • 行业案例:高德服务单元化方案和架构实践
  • WINFORM - DevExpress -> devexpress版--报表(report)
  • 《CPython Internals》阅读笔记:p118-p150
  • 苹果手机(IOS系统)出现安全延迟进行中如何关闭?
  • redis 缓存使用
  • uniapp打包apk允许横屏竖屏内容翻转
  • 【计算机网络2】计算机网络的性能能指标
  • 深入解析 `DataFrame.groupby` 和 `agg` 的用法及使用场景
  • VScode MAC按任意键关闭终端 想要访问桌面文件
  • Unity3D Shader变体自定义组合压缩方案详解
  • Next.js搜索引擎优化:如何利用React和Next.js解决SEO问题
  • RequestContextHolder 与 HttpServletRequest 的联系
  • The Rise and Potential of Large Language ModelBased Agents:A Survey---讨论
  • 博弈论3:图游戏SG函数(Graph Games)
  • 使用 MyBatis-Plus Wrapper 构建自定义 SQL 查询
  • Spark内存都消耗在哪里了?
  • PHP与AJAX:实现动态网页的完美结合
  • 浏览器事件循环机制
  • PostgreSQL约束延迟生效
  • 消除图片中的浅色水印
  • sql server 数据库还原,和数据检查
  • jedis,lettuce,redisson对比
  • ARM CCA机密计算安全模型之固件启动
  • armsom产品编译烧录Linux固件