That generally should be an error, as we normally require modules to be unique based on the combination of LOCAL_MODULE / LOCAL_IS_HOST_MODULE / LOCAL_MODULE_CLASS (this is in
build/make/core/base_rules.mk)
If that isn't triggering, you may be making two rules to create the same /system/frameworks/X.jar, and you should be getting a warning like this:
build/make/core/....mk:LLL: warning: overriding commands for target `out/target/product/mydevice/system/frameworks/X.jar'
build/make/core/...mk:LLL: warning: ignoring old commands for target `out/target/product/mydevice/system/frameworks/X.jar'
That should be an error by default unless you've got BUILD_BROKEN_DUP_RULES set (at least as of Android-Q iirc). That means you're getting one of the two, or sometimes a mix, but we don't really even guarantee which one you'll get (it's fairly stable, but can change based on ordering/etc).
What did you intend for the snippet to do? How would we install both classes.jar and classes-header.jar onto the device? Same filenames? Different filenames? Why do they share the same module name?
- Dan