Error no classes dex file found

android/apk/classes.dex not found (RuntimeError) #12564


i just install metasploit-framework on windows in the morning,and it work just fine,
but when i enter ‘msfconsole’ in the cmd,it report error

Traceback (most recent call last): 25: from D:/metasploit-framework/bin/../embedded/framework/msfconsole:49:in ‘ ‘ 24: from D:/metasploit-framework/embedded/framework/lib/metasploit/framework/command/base.rb:82:in ‘start’ 23: from D:/metasploit-framework/embedded/framework/lib/metasploit/framework/command/console.rb:48:in ‘start’ 22: from D:/metasploit-framework/embedded/framework/lib/metasploit/framework/command/console.rb:62:in ‘driver’ 21: from D:/metasploit-framework/embedded/framework/lib/metasploit/framework/command/console.rb:62:in ‘new’ 20: from D:/metasploit-framework/embedded/framework/lib/msf/ui/console/driver.rb:161:in ‘initialize’ 19: from D:/metasploit-framework/embedded/framework/lib/msf/base/simple/framework/module_paths.rb:49:in ‘init_module_paths’ 18: from D:/metasploit-framework/embedded/framework/lib/msf/base/simple/framework/module_paths.rb:49:in ‘each’ 17: from D:/metasploit-framework/embedded/framework/lib/msf/base/simple/framework/module_paths.rb:50:in ‘block in init_module_paths’ 16: from D:/metasploit-framework/embedded/framework/lib/msf/core/module_manager/module_paths.rb:40:in ‘add_module_path’ 15: from D:/metasploit-framework/embedded/framework/lib/msf/core/module_manager/module_paths.rb:40:in ‘each’ 14: from D:/metasploit-framework/embedded/framework/lib/msf/core/module_manager/module_paths.rb:41:in ‘block in add_module_path’ 13: from D:/metasploit-framework/embedded/framework/lib/msf/core/module_manager/loading.rb:133:in ‘load_modules’ 12: from D:/metasploit-framework/embedded/framework/lib/msf/core/module_manager/loading.rb:133:in ‘each’ 11: from D:/metasploit/framework/embedded/framework/lib/msf/core/module_manager/loading.rb:135:in ‘block in load_modules’ 10: from D:/metasploit-framework/embedded/framework/lib/msf/core/modules/loader/base.rb:256:in ‘load_modules’ 9: from D:/metasploit-framework/embedded/framework/lib/msf/core/modules/loader/base.rb:256:in ‘each’ 8: from D:/metasploit-framework/embedded/framework/lib/msf/core/modules/loader/base.rb:259:in ‘block in load_modules’ 7: from D:/metasploit-framework/embedded/framework/lib/msf/core/payload_set.rb:100:in ‘recalculate’ 6: from D:/metasploit-framework/embedded/framework/lib/msf/core/payload_set.rb:100:in ‘each_pair’ 5: from D:/metasploit-framework/embedded/framework/lib/msf/core/payload_set.rb:104:in ‘block in recalculate’ 4: from D:/metasploit-framework/embedded/framework/lib/msf/core/payload_set.rb:104:in ‘each_pair’ 3: from D:/metasploit-framework/embedded/framework/lib/msf/core/payload_set.rb:160:in ‘block (2 levels) in recalculate’ 2: from D:/metasploit-framework/embedded/framework/lib/msf/core/payload.rb:204:in ‘size’ 1: from D:/metasploit-framework/embedded/framework/lib/msf/core/payload/android.rb:38:in ‘generate’ D:/metasploit-framework/embedded/framework/lib/msf/core/payload/android.rb:117:in ‘generate_jar’: android/apk/classes.dex not found (RuntimeError)

what went wrong,
it shows ‘android/apk/classes.dex not found’,but it works perfectly in the morning

The text was updated successfully, but these errors were encountered:


Creating and Deploying a classes.dex File Manually

Creating and deploying a classes.dex file manually allows you not only to add libraries to your application, but also to modify the built-in RAD Studio Java libraries for Android, or remove those that you do not need. If you just need to add a custom Java library to your application for Android, see Adding A Java Library to Your Application Using the Project Manager.


Creating a classes.dex File

The classes.dex file is a Dalvik Executable file that all Android applications must have. This file contains the Java libraries that the application uses.

When you deploy an application for Android, RAD Studio includes a classes.dex file that contains the RAD Studio built-in Java libraries. To use your own Java libraries in your RAD Studio applications, you must create a new classes.dex file that includes both those RAD Studio built-in Java libraries that your application needs and your own Java libraries.

Determining Which JAR Files to Include in Your classes.dex File

To create your new classes.dex file, you need the JAR files of every Java library that your applications use, as well as the JAR files of the libraries on which those libraries depend.

This affects the RAD Studio built-in Java libraries as well. For example, if your applications need the Google Play Services Java library, your classes.dex file must also contain the JAR file of the Google Play Application Licensing Java library, because Google Play Application Licensing is a dependency of Google Play Services. If Google Play Application Licensing had its own dependencies, you would have to include those as well.

The following table lists the dependencies of the RAD Studio built-in Java libraries:

You can find these JAR files in the following folders within the RAD Studio installation folder ( C:\Program Files (x86)\Embarcadero\Studio\22.0 ):

You can either include all the RAD Studio built-in Java libraries in your classes.dex file or determine, based on the information in the table above, which RAD Studio built-in Java libraries your applications need.

Warning: You must always include the Java libraries that are Required by RAD Studio in your custom classes.dex file.

Generating a classes.dex File from JAR Files

Once you have determined which JAR files your Android applications need, you can create a classes.dex file from them.

To create a classes.dex file, you need to use the command-line tool dx . You can find this command-line tool at C:\Users\Public\Documents\Embarcadero\Studio\22.0\CatalogRepository\AndroidSDK- .

Run dx with the —dex parameter, the —output parameter with the output path of the classes.dex file as its argument, and a space-separated list of paths to the JAR files that you want to include in the generated classes.dex file. For example:

Deploying the classes.dex File

To configure your Android application to be deployed with your custom classes.dex file:

  1. Select Project > Deployment to open the Deployment Manager.
  2. Uncheck the checkbox of the default classes.dex file.
  3. Click the button and add your custom classes.dex file to the list of deployment files.
  4. Change the Remote Path of your new entry to classes\ .
  5. Change the Platforms of your new entry to Android only.


Invalid or Missing classes.dex File

This is the error message that you see when you run an application on an Android device using RAD Studio and your application does not have a valid classes.dex file:

An Android application package (APK file) must always contain a valid classes.dex file. That is:

  • There must be a classes.dex file in the APK file.
  • The classes.dex file must be located at classes/classes.dex within the APK file.
  • The classes.dex must be a valid Dalvik executable.

When you use a custom classes.dex file, you must be careful. After you unckeck the default classes.dex file on the Deployment Manager and you add an entry for your custom classes.dex file:

  • Make sure that the entry of your custom file is checked.
  • Make sure that the Remote Path of your new entry is classes\ .
  • Make sure that your new entry is your classes.dex file, and not a different file that may not be a valid Dalvik executable.

If your Android application is not configured to be deployed with a valid classes.dex file, and you run your application on an Android device from RAD Studio or install on your device an APK file of your application generated with RAD Studio, the installation will fail, but it will leave data in your Android device preventing you from installing applications with the same package name as your application (see Android Version Info).

After you attempt to install an APK file without a valid classes.dex file, the only know solution is to perform a factory reset of your Android device.

Warning: A factory reset removed all date from your device (personal data, custom settings, and more). Carefully consider whether fixing the issue is worth losing your data. If you decide to go forward, remember to back up your data before you perform the factory reset.


«boot-framework.oat» has no dex files #810


I copied,boot-framework.oat and boot-framework.vdex from Android 11 device.
But baksmali list no dex in .oat and could not deodex them:

What should be done to modify this file?

The text was updated successfully, but these errors were encountered:

On the Android 11 devices I’ve seen (only pixel devices), there is no need to deodex the framework. The dex files are stored as-is in the framework jar files.

It’s 1+ 7 pro, modifying only framework.jar gives bootloop, and I don’t know why.
I am trying to replace Activity.onWindowFocusChanged with modification to make all apps fullscreen by default:
Modify it to:

$ baksmali d —api 30 -j 12 framework.jar/classes.dex
Then patched file and assembled it:
$ smali a —api 30 -j 12 —verbose out/
After that I copied original framework.jar, deleted classes.dex in it and replaced them with out.dex (renamed)
Zipaligned and put it to /system/framework and got infinte loading:
framework.jar and framework.aligned_mod.jar are here
But after restoring backed-up framework.jar boot procedure continues.

If framework.jar has a classes.dex file, why are you trying to deodex anything? The point of deodexing is to recover the classes.dex file when it has been removed from the jar/apk and converted to an odex/oat/vdex/whatever. But if you already have the original classes.dex file, you don’t need to deodex anything.

I took a quick look at your 2 framework jars. It looks like smali or baksmali may be mangling the hidden api restriction flags at some point. I tried just disassembling and reassembling the original framework.jar without any modifications, and most/all of the hidden api restrictions seem to have been modified at some point during the round-trip.

I’ll investigate more, and see if I can figure out where the problem is.

I understand, but at first I tried using apktool. And jar from it gave errors something about loading boot-framework.oat, so I thought that I’ll have to recompile them.
EDIT: Error was «Failed to load boot image extension /system/framework/framework.jar: Failed to open oat file ‘/system/framework/arm/boot-framework.oat'»
But still, is empty dex list expected (and why if so)?
Also, should baksmali — smali give different from input file?

@JesusFreke are there any updates?

same error 🙁
Have any update for it? @JesusFreke
Every time smali with —api-level 29 option to work around when i recompile framework.jar without any modify, it create new framework.jar file that have half size of old framework.jar
If I put back mod framework.jar, my device can not boot to android, stuck at boot animation.

@JesusFreke has any good news?

This is probably fixed by #816

Hi @JesusFreke
I tried #816 commit but this is not working!

I just recompile classes.dex in framework.jar
It gave error: ‘Unable to find class android/app/admin/SecurityLog$SecurityEvent’

04-20 00:01:57.140 20598 20598 F libc : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 20598 (main), pid 20598 (main)
04-20 00:01:57.168 20649 20649 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-20 00:01:57.168 20649 20649 F DEBUG : LineageOS Version: ‘17.1-20220214-UNOFFICIAL-starlte’
04-20 00:01:57.168 20649 20649 F DEBUG : Build fingerprint: ‘samsung/starltexx/starlte:10/QP1A.190711.020/G960FXXU7DTAA:user/release-keys’
04-20 00:01:57.168 20649 20649 F DEBUG : Revision: ’26’
04-20 00:01:57.168 20649 20649 F DEBUG : ABI: ‘arm64’
04-20 00:01:57.169 20649 20649 F DEBUG : Timestamp: 2022-04-20 00:01:57+0700
04-20 00:01:57.169 20649 20649 F DEBUG : pid: 20598, tid: 20598, name: main >>> zygote64 >> zygote


ERROR: No dex file(s) found, probably your file is odexed. #10


I become the following error, can you help me?

*** OS: Windows 10 (win32)
*** Mode: 1
*** Selected device: TAXXXXFKP1
*** Working dir: c:\users\user\appdata\local\temp\tmpazekga
*** Pulling framework from device.
100 KB/s (310 bytes in 0.003s)
*** Disassembling framework.

ERROR: No dex file(s) found, probably your file is odexed.

I have Install cm13 nightly for falcon device

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

The text was updated successfully, but these errors were encountered:

unfortunately currently Tingle doesn’t support odexed ROMs directly.

But it should work correctly if you deodex your ROM before using Tingle.
There is a tool for this here: Universal Deodexer

@port3306: Have you been able to patch?

For any problem just ask 🙂

Will Tingle work if I deodex only relevant file? content.jar, for example?

@pejakm: Tingle works also if you only deodex the framework.jar but I’m not sure if the signature spoofing will work in this case, I haven’t tested it.

I’m having the same issue with CyanogenMod 14.1. How can I deodex it (I’m running Linux, your link above is for Windows)? Will it be odexed again after patching?

Tingle will just patch a deodexed framework.jar and the file remains deodexed.
To be sure to make it working you have to deodex the entire ROM.
I will create a tool to deodex the entire ROM in the future but there isn’t an ETA yet.

Maybe there are other ways to make it working but I don’t know enough about this and I cannot guarantee it will work.

OK, waiting for your tool then. So, is it something new that CM is odexing their ROMs?

They have started at some point, not really new.
But there are also custom CM that aren’t odexed at XDA forums.

Could it be that it expects the user to have booted and passed optimization before patching? Could it be that these failures to patch are because it can’t find the dex file because it hasn’t been generated yet (That’s how it works right?). Seeing similar reports here

AFAIK this is the only working option to use signature-spoofing on Android 7+ (LO 14.1) at the moment, so thanks for that. I’m using bacon ‘s build which is deodexed and it works great.

@xenithorb: This tool is currently only for patching deodexed files, so before using you have to deodex your ROM.
I plan to simplify things in the future but currently there isn’t any other way.

This tool is currently only for patching deodexed files, so before using you have to deodex your ROM.

I totally understand that but it’s not what I’m asking.

How does this tool work on a freshly flashed /system (from a deodexed rom) that hasn’t been booted yet? Presumably dex files wouldn’t exist yet, right?

Could it be that it expects the user to have booted and passed optimization before patching?

Presumably dex files wouldn’t exist yet, right?

tingle patches dex files, not the ART cache. dex files are what is shipped in a deodexed rom.

AFAIK this is the only working option to use signature-spoofing on Android 7+ (LO 14.1) at the moment

doesnt my tool haystack support 7? dont remember, but i think it does.

@xenithorb: A deodexed ROM (the one that take longer on the first start to optimize) have all dex directly while an odexed ROM have files already optimized (and they cannot be patched unless «deoptimized aka deodexed»).

OK. I’ll just have to wait and see what build those people are using and for what device to tell if it’s odexed. I wasn’t aware that they were. for whatever reason being a bacon user for 3 years on CM It was always deodexed, so I was trying to think of other possibilities of why it would fail to work. Thanks for the input!

(It was my misunderstanding that .dex was what was generated by optimizing on an deodexed rom on first-boot)

Sorry but, may I ask for ETA for this tool you mentioned about odexed roms, @ale5000-git ?

So, I’m on Z00L. After a comment from another user that this ROM was similar to Z00T, I’ve tried to patch using tingle again. No luck..
Navigating on folders, I see no *.odex files (was I supposed to see?). Also, I’ve tried using the Universal Deodexer cited by @ale5000-git a few comments before.
It simply deleted the files that was supposed to deodex. I assumed that Universal Deodexer assumed that those files were already deodexed and had nothing to do with it. Not sure if my assumption is right.

I also had no luck with Universal Deodexer or other similar windows tools. They all seem to fail for lineage os 14.


Читайте также:  Type one error chart
Оцените статью
Library JAR File Dependencies Required by RAD Studio
  • Google Play Application Licensing
  • Google Play Application Licensing
  • FireMonkey
  • Google Play Application Licensing
  • FireMonkey
  • Google Play Application Licensing