-
Notifications
You must be signed in to change notification settings - Fork 371
Description
@stewartmiles The change previously marked as fixed in #123 (and released as resolver v1.2.75) seems to have broken something that wasn't broken in resolver v1.2.72.
Example project containing the bugs:
MixedDependencyVersionBug_v1.2.75.zip
The example contains the following dependencies:
<androidPackage spec="com.google.android.gms:play-services-ads:8.4+">
<androidPackage spec="com.google.android.gms:play-services-ads:9.+">
<androidPackage spec="com.google.android.gms:play-services-analytics:11.8+">
The resolution actually failed completely with the following error:
Resolution failed
Failed to fetch the following dependencies:
com.google.android.gms:play-services-clearcut:11.8+
After some research (mainly looking at the dependencies listed in mvnrepository.com) I figured out that clearcut
was added for ads 9.8
(see: https://mvnrepository.com/artifact/com.google.android.gms/play-services-ads/9.8.0) and removed again later on (somewere in version 11.1+ ; but added again at 15.0.1 but this addition is irrelevant in this particular case, source: https://mvnrepository.com/artifact/com.google.android.gms/play-services-ads/11.8.0).
From your previous replies (in issue 123) I've learned that the resolver simply bumps to the highest version, which would be (looking at the 3 dependencies mentioned above) v11.8 ; which is correct and should indeed be used.
Yet the resolver forgets to actually check the required dependencies for the final version it has chosen to resolve.
What I believe that happens is that it find ads 9.8, looks up the dependencies of ads 9.8 and adds it to a list. Then later decides to has to bump the version to 11.8, without re-evaulating the actual dependencies of ads 11.8 and simply bumping the sub-dependencies (obtained based on 9.8) to 11.8. And then obviously clearcut 11.8 won't exist, because it simply isn't a dependency of ads 11.8 anymore in the first place.
Perhaps it could also have something to do with the fact that 2 version increments occur throughout the resolution process, first from 8.4+ to 9.+ (9.8) and then from 9.+ (9.8) to 11.8+