之后会在out下天生classes.dex。看了一下先容,安卓的虚拟机的字节码是DEX bytecode,和一样平常的虚拟机还有差别,所以这里要处置处罚下。
d8: This tool is the DEX compiler. It takes Java bytecode (.class files) and converts it into DEX bytecode (.dex files), which is what the Android Runtime (ART) executes.
aapt (Android Asset Packaging Tool): This tool is used to package resources (like layouts, images, and strings) into a compiled format that Android can understand. It also handles the creation of the resources.arsc file and the AndroidManifest.xml processing.
最后,谷歌官方是很不推荐这种做法,推荐用Android Studio和Gradle,来由如下: Important Considerations
Complexity: This process is very manual and error-prone.
Maintenance: Maintaining a project built this way is extremely difficult.
Features: You're missing out on all the features and optimizations that Gradle provides.
Dependencies: Managing dependencies manually would be a nightmare.
Android Studio: Android Studio and Gradle are designed to make Android development much easier.
Android SDK: You need to have the Android SDK installed and configured correctly.
Environment Variables: You need to set the ANDROID_HOME environment variable.
Missing files: You need to create the res directory and the strings.xml file.
Conclusion
While you can technically create a very simple Android 9 APK using aapt and d8 directly, it's strongly discouraged for anything beyond experimentation or very specific edge cases. Gradle is the standard build system for Android, and it provides a much more robust, efficient, and maintainable way to develop Android apps. I highly recommend using Gradle unless you have a very compelling reason not to.
之前倒是写过一个Gardle的文,但是很简单,也没有涉及到apk这一层。可以看看:Android学习18 -- Gradle_resourcehashescache.bin-CSDN博客