Kayacan Kaya
11/10/2022, 4:10 PMbuild.gradle
is as follows:
build.gradle
{
implementation Deps.libDependency
implementation Deps.otherLibDependency
}
where it gets the dependencies from the kotlin object called Deps
. My Deps
and Versions
objects are as follows:
Dependencies.kt
object Versions {
const val someDeps = "1.1.1"
const val someOtherDeps = OtherDeps.VERSION
}
object Deps {
const val libDependency = "com.example.tools:${Versions.someDeps}"
const val otherLibDependency = "com.another.tools:${Versions.someOtherDeps}"
}
as seen, my Versions
object is making use of another object called OtherDeps
for getting a dependency version for another library from another object. My OtherDeps
object is as follows:
OtherDeps.kt
object OtherDeps{
const val VERSION = "1.2.1"
}
The problem: Whenever I change OtherDeps.VERSION
and gradle sync the dependencies, it does not update and fetch the new otherLibDependency
version. I tried deleting all the caches, nothing worked. The only way that I was able to fetch the new OtherDeps.VERSION
was to make a change in Dependencies.kt
file (could be anything like adding dummy varible etc). After that, gradle sync could fetch the new version of otherLibDependency
. Is there any solution to this problem/bug?