Refreshing Gradle dependencies doesn't work sometimes

Answered

After pulling sources, some deps versions were updated, in gradle.properties aVersion variable, later used in a module's build.gradle:

implementation "com.my_dep:$aVersion"

 

Gradle can build project with actual version, but IDEA shows old versions all the time, reloading all gradle projects doesn't help, clearing cache neither, i can see old versions in project configuration->my module->deps

 

IDEA 2020.3.2 ultimate

0
4 comments

Do you see this problem only with some specific dependencies? What are those dependencies?

What version is shown when listing the dependencies by Gradle from command line:

./gradlew -q dependencies

And what version is shown in Gradle tool window?

Also please attach IDE logs to check (Help | Collect Logs and Diagnostic Data action). For uploading you can use https://uploads.jetbrains.com or any file sharing service.

0
Avatar
Permanently deleted user

Gradle was showing correct (new version), as i stated, and was able to build project. IDEA was still showing old version (after trying to refresh and restart few times).

Finally I removed/deleted project and imported it again - that solved my issue.

 

Upload ID: 2021_02_23_RDCfNqHs4U2tBoRW

 

 

0

Thank you. Could be related to https://youtrack.jetbrains.com/issue/IDEA-262218

>IDEA was still showing old version (after trying to refresh and restart few times).

Have you checked the version in IDE Gradle tool window by chance?

0
Avatar
Permanently deleted user

you mean by running Gradle tool window -> project -> my_module -> help -> dependencies ?

i didn't have a chance to run it.

gradle from command line

./gradlew :my_module:dependencies | grep my_dep

was printing correct (new) version.

and i use gradle to build and run and gradle from 'gradle-wrapper.properties' file

 

my dep is declared under my_module directory in build.gradle as

dependencies {
implementation "com.<my_company>:abc:$aVersion"
0

Please sign in to leave a comment.