0

I'm trying to build android 12. I was using Ubuntu 22.04.2 where it worked successfully. Now I've installed a fresh Ubuntu 22.04.3 which is using a new kernel and I started getting this error:

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.

I've seen this similar issue Android dex2oat build:ERROR: Dex2oat failed to compile a boot image - Nothing worked for me from this thread

  1. Tried running build with additional flags: ALLOW_MISSING_DEPENDENCIES=true WITH_DEXPREOPT=false ART_BOOT_IMAGE_EXTRA_ARGS="--runtime-arg -verbose:verifier" m -j4
  2. Tried remove flags ("-msse4.2" and "-mpopcnt") in art/build/Android.bp (https://i.stack.imgur.com/39O63.png)

1 Answers1

0

So after some digging AOSP code I've came up with this workaround. Note that I don't think its a solution - just a workaround. Basically it figures out that WITH_DEXPREOPT is overriden in build scripts. In my AOSP version it was in build/core/board_config.mk

Workaround:

  1. In build/core/board_config.mk set WITH_DEXPREOPT to false build/core/board_config.mk
  2. Silence the error in build/core/dex_preopt_config.mk by removing $(call pretty-error, DEXPREOPT must be enabled for user and userdebug builds) build/core/dex_preopt_config.mk