Current location - Health Preservation Learning Network - Slimming men and women - Manually generate dex from Android studio. Class file.
Manually generate dex from Android studio. Class file.
Note: I wrote this article to let those children's shoes who are learning Android hot repair know about it. Of course, if it's Daniel, you can skip it.

Click build->; Rebuild the project, click Finish, and the class files that need to be packaged into jar will be displayed in the directory shown below, which indicates the class files that we need to package, and the generated class files are in app/build/mediators/classes.

Let's take an example first: take a. class file here, such as Test.class, and generate dex?

. Class needs dx.bat supported by androidstudio to generate dex. We found it.

Build tool file directory.

Open cmd to run the command:

dx - dex - output? The directory where dex needs to be generated and the directory where the name class file is located.

For example, I need to generate a dex file in the folder directory of drive C and a class file in the directory of drive C.

Just add-no-strict after-dex.

Make compiler monitoring less strict.

As follows: dx-dx-dex-no-strict-output?

Compiled successfully, dex file generated successfully.