问题:
ninja: error: 'out/target/common/obj/JAVA_LIBRARIES/xxx_intermediates/classes.dex.toc', needed by 'out/target/common/obj/APPS/yyy_intermediates/with-local/classes.dex', missing and no known rule to make it
解决办法:
How to generate classes.dex.toc files?
https://stackoverflow.com/questions/43471694/how-to-generate-classes-dex-toc-files
Usually such toc file will be auto generated during fullbuild, but if it is missing when you build single module you can manually generate the classes.dex.toc with the following command:
dexdump2 classes.dex >> classes.dex.toc
If you want to know the details, please read the sourcecode of android build system: _transform_dex-to-toc
https://android.googlesource.com/platform/build/+/f972a4a980660d2347ace8fdc7c668403c0e9697/core/definitions.mk