Running dex2oat on host computer I have compiled dex2oat on linux-x86_64 for linux-x86. I can run it just like a normal application. The background is, I have a tool which can generate dex codes and I want to perform some basic checks that dex2oat does. So it is not important for me to get an actual runnable file.

I do get the following output:

dex2oat I  4183  4183 art/dex2oat/dex2oat.cc:1239] out/host/linux-x86/bin/dex2oat --runtime-arg -Xms64m --runtime-arg -Xmx64m --image-classes=frameworks/base/preloaded-classes --dex-file=/home/marc/Apps/Example1.apk --dex-location=bla.apk --oat-file=bla.oat --image=out.art --base=0x60000000 --instruction-set=x86 --instruction-set-features=default --runtime-arg -Xrelocate --host --android-root=out/host/linux-x86 --include-patch-information
dex2oat E  4183  4183 art/runtime/runtime.cc:1108] Failed to return pre-allocated NoClassDefFoundError
dex2oat F  4183  4183 art/runtime/thread.h:330] Check failed: new_exception != NULL 
dex2oat F  4183  4183 art/runtime/runtime.cc:284] Runtime aborting...
dex2oat F  4183  4183 art/runtime/runtime.cc:284] Aborting thread:
dex2oat F  4183  4183 art/runtime/runtime.cc:284] "main" prio=5 tid=1 Runnable (still starting up)
dex2oat F  4183  4183 art/runtime/runtime.cc:284]   | group="" sCount=0 dsCount=0 obj=(nil) self=0xf89a8e78
dex2oat F  4183  4183 art/runtime/runtime.cc:284]   | sysTid=4183 nice=0 cgrp=user/1000.user/c2.session sched=0/0 handle=0xf6b76700
dex2oat F  4183  4183 art/runtime/runtime.cc:284]   | state=R schedstat=( 17496280 53788 15 ) utm=1 stm=0 core=7 HZ=100
dex2oat F  4183  4183 art/runtime/runtime.cc:284]   | stack=0xff0f1000-0xff0f3000 stackSize=7MB
dex2oat F  4183  4183 art/runtime/runtime.cc:284]   | held mutexes= "abort lock" "mutator lock"(shared held)


Does anyone know what causes this error or did I supply the wrong arguments?

I have added a cout statement in the code and it turns out that the class being searched for is Ljava/lang/Object;
Taken from the android build process:

out/host/linux-x86/bin/dex2oatd --runtime-arg -Xms64m --runtime-arg -Xmx512m --boot-image=out/target/product/ranchu/dex_bootjars/system/framework/boot.art --dex-file=out/target/product/ranchu/obj/APPS/Telecom_intermediates/oat/arm64/package.odex.input --dex-location=/system/priv-app/Telecom/Telecom.apk --oat-file=out/target/product/ranchu/obj/APPS/Telecom_intermediates/oat/arm64/package.odex --android-root=out/target/product/ranchu/system --instruction-set=arm64 --instruction-set-variant=generic --instruction-set-features=default --include-patch-information --runtime-arg -Xnorelocate --no-generate-debug-info --abort-on-hard-verifier-error --no-inline-from=core-oj.jar