I have an app that has several artifact dependencies. These artifacts depend on themselves too.
So I can Have a tree of dependencies.
___ B
A \
_______ C
Let's imagine that A depends on B and C, and B depends also on C.
B depends on C:1.0.1 A depends on C:1.0.1.1
I expect that when my app is compiled and run, only later version is used. However this doesn't happen.
When I run my app , and debug a C class during main A app flow, it uses the later C version, however when A calls B which in turn calls C, it uses the old version.
I don't expect the same class version to be twice in the project. How is this possible and why isn't gradle only taking the latest version as it is supposed to do.
The aar dependency is resolving twice:
Solved,
The problem was a huge dependency mismatch. Also, constants (f.e. in kotlin using const val
) are saved as compile values instead of making reference to the actual constant (such as with val
) in the referenced library.
If you need to change behavior of app by updating only the constants file in a library, be sure that the constant is not declared as such and instead use non variable values that are accessed through get method.