Did not resolve org.jetbrains.kotlin:kotlin-stdlib-common:2.2.0 which is part of the dependency lock state

1 week ago 13
ARTICLE AD BOX

I have a 3 modules in my Android app. The modules are app, devCore, myLibrary. Where myLibrary is library module. I am enforcing dependency locking for build.gradle files using

dependencyLocking { lockAllConfigurations() tasks.register("resolveAndLockAll") { notCompatibleWithConfigurationCache("Filters configurations at execution time") doFirst { require(gradle.startParameter.isWriteDependencyLocks) { "$path must be run from the command line with the `--write-locks` flag" } } doLast { configurations.filter { // Add any custom filtering on the configurations to be resolved it.isCanBeResolved }.forEach { it.resolve() } } } }

After locks are generated for all 3 modules using --write-locks, 3 gradle.lock files for each module is generated. After installing debug Apk, I am able to install Apk and run it. While generating the release Apk I am getting error for org.jetbrains.kotlin:kotlin-stdlib.

Execution failed for task ':myLibrary:minifyLibDefaultReleaseWithR8'. > Could not resolve all files for configuration ':myLibrary:libDefaultReleaseRuntimeClasspath'. > Did not resolve 'org.jetbrains.kotlin:kotlin-stdlib-common:2.2.0' which is part of the dependency lock state

Looks like some version is locked during compilation and at runtime it tries to bring some dependencies transitively.
How to fix this error and what should be the approach in Android to lock the dependency where the project is multi-module and a combination of app & library module.
As per AI it says Never record or enforce Kotlin stdlib versions in lockfiles and Disable locking for Android runtime classpaths.
Is it really recommended solution to apply dependency-locking in Android.

Read Entire Article