Steps to reproduce the problem (including sample code if appropriate):
- Import an old dependency in app(base) module.
- Import new version of the same dependency in the install-time feature module (with possibly new classes added)
- Build AAB
- Upon analysing AAB, new classes added in latest version of the dependency are not present in DEX.
- This leads to runtime crashes like NoSuchMethodError because install-time feature module depends on latest version of the dependency but old version was used by Gradle.
Sample Repository: https://github.com/Harsh2098/Install-Time-Dependency In the screenshots, notice that if only the install-time module uses latest version then final AAB does not contain classes like AfterCallback and ClosedCallback.
Ideally correct behaviour should be:
Gradle should be using latest library version and not the one defined in base module.
We tried with AGP 7.2.1 as well as 4.1.3.
Here in the sample repository, no.nordicsemi.android:ble
is used as an example. The issue happens irrespective of the library used.