1

Steps to reproduce the problem (including sample code if appropriate):

  1. Import an old dependency in app(base) module.
  2. Import new version of the same dependency in the install-time feature module (with possibly new classes added)
  3. Build AAB
  4. Upon analysing AAB, new classes added in latest version of the dependency are not present in DEX.
  5. 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.

When only Feature module is using latest version

When app module is using latest version too. Here, classes from new library version are present.

Harsh Mahajan
  • 21
  • 1
  • 7
  • Same here. Any findings? – Tomer Petel Aug 16 '22 at 12:08
  • @TomerPetel I haven't found solution other than a manual python script. In your project you are using latest version of AGP and have eliminated other factors that might result in this issue right? You may add more details here https://issuetracker.google.com/issues/242224713 – Harsh Mahajan Aug 17 '22 at 02:11

0 Answers0