0

I am trying to compile an APK (more specifically, a dex file) to an OAT using dex2oat on a Linux host. I followed the instructions given here and I get the following error:

Could not create image space with image file '/home/user/Documents/Android/out/host/linux-x86/framework/x86_64/core.art'. Attempting to fall back to imageless running. Error was: Cannot compile image to /home/user/Documents/Android/out/host/datadir/dalvik-cache/x86_64/dalvik-cache/x86/home@user@Documents@Android@out@host@linux-x86@framework@x86_64@core.art: Image compilation disabled.

Does it ring a bell, or is there another way to compile to OAT without using an emulator or a VM?

marteng
  • 1
  • 1
  • 1
    Yes, it's possible. The Android build system does it. But why do you want to? An oat file is only valid for the specific device type + firmware version it was created for. – JesusFreke Jun 25 '18 at 17:32
  • I have to study the assembly instructions of the OATs, and I would like to have an efficient way to produce a lot of them without using an emulator. So it does not matter whether I can actually run them as long as I have access to their "algorithms". – marteng Jun 26 '18 at 07:09
  • Personally, I would look at the Android build system. I don't have any details offhand, but it has mechanisms for bundling pre-built apks into a system image, including pre-oating them. And then, either use those mechanisms directly, or run a build with the "showcommand" command, to see the exact dex2oat command, and any other related commands, as necessary. – JesusFreke Jun 26 '18 at 17:02

0 Answers0