-
-
Notifications
You must be signed in to change notification settings - Fork 358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cousier resolution error for Android aar dependencies #3993
Comments
@himanshumahajan138 This is not Compose or some other particular artifact issue, but a dependency resolution issue with the outcome different from the expected one (if we consider outcome of Gradle as a reference), so let's avoid adding more comments on "solution", because it doesn't lay in the build script, but either on the Mill side or Coursier side (are some resolution strategies used only for the particular artifact types? That would explain why resolution for What you are proposing simply doesn't work, because:
This is like throwing the dice randomly hoping for the good outcome. Dependency management system should resolve the case of the different versions for the same artifact.
This is rather a side note: you shouldn't normally override
Here it is not a conflict of Compose libs, but rather the conflict of transitive dependencies from the dependency tree. And no, BOM won't save you from the potential conflicts, because: a) it may not cover all transitive dependencies; b) user may explicitly specify the version of the artifact mentioned in BOM in their build script. For example, you can check what Compose BOM really contains and as you can see, it covers only Compose artifacts, but not their transitive dependencies, obviously.
Nothing restricts anything, using latest versions is not a requirement and is not a solution. The only constraint is matching between Compose Compiler and Kotlin (because of compiler extensions), which is not pulled in the build script above. The temporary correct workaround for such issues is using |
@0xnm Sorry for Unusual "solution" Comments... I was wrong and the way i was thinking was also wrong no worries Now i Got the Straight Look and clear mind for this issue, if possible and under my knowledge i will provide some good insights... Apologies... |
Adding a few more dependencies makes it work:
(it does on the command-line for sure, let me know if ever it doesn't from Mill) It's kind of tricky to explain in detail how I got these extra dependencies. I used the coursier command-line, It can be used like
|
We could maybe print those conflicts in Mill too. Making sense of them can be tricky sometimes though. Ideally, we should understand how Gradle deals with those, and maybe do the same or something similar in coursier. |
Seems the detailed output in case of conflicts is printed in Mill too actually… |
@0xnm In gradle-compile-and-runtime-deps-tree.txt that you attached, do you know where the lines with
Could a BOM have been added somewhere? |
I think I know what is going on here: probably it is because of the Because, for example, if we check POM file of So the version can be brought as a transitive rule of the I'm also attaching the result of dependency-insight-androidx-collection.txt Update: okay, it is not because of the
We can see, that
So I guess Gradle cuts the corner and relies on |
The current coursier version that Mill uses ( That being said, while investigating these dependencies earlier, I basically got the same results with older ( |
Yes, that is not because of the |
Repro steps:
AndroidAppKotlinModule
(doesn't really need to be this one, just make sure thatartifactTypes
has alsocoursier.Type("aar")
, but probably it doesn't matter at the POM resolution stage) with the following content:ivyDepsTree
for this module.The outcome will be an error:
At the same time if same dependencies are added in a Gradle build script via implementation dependency configuration, everything is resolved correctly (see attached file for the complete resolution tree).
I'm not sure where the issue is, probably rather on the Coursier side?
Gradle is using the following conflict resolution strategy by default (link):
mill-deps-tree.txt
gradle-compile-and-runtime-deps-tree.txt
The text was updated successfully, but these errors were encountered: