updated intellij and now it looks like intellij is...
# gradle
m
updated intellij and now it looks like intellij is using the wrong gradle version for my module to compile the scripts so now everything is red🤦‍♂️
e
I just upgraded to 2018.3.4 eap and Kotlin 1.3.20-eap and I don’t experience that issue. I didn’t either before upgrading. What versions are you using?
m
Copy code
IntelliJ IDEA 2018.3.3 (Ultimate Edition)
Build #IU-183.5153.38, built on January 9, 2019
Licensed to Mike Kobit
Subscription is active until August 7, 2019
JRE: 1.8.0_152-release-1343-b26 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.15.0-43-generic
i have multiple intellij modules in an intellij project which are each gradle projects (some bein multi-projec) and nearly all having
buildSrc
. some using 5.0 still and some being 5.1.1. all using the intellij "default wrapper settings" option. even though synchronization works fine and the log shows all ✔️ , intellij shows the "build configuration failed" message. nothing showing up in intellij's
idea.log
regarding the failure. "invalidate and restart" doesn't fix it, either. it looks like something in intellij not using the right wrapper for the module or something because jumping from build to gradle source takes me to 5.0 but jumping from
buildSrc/src/main/kotlin
code takes me to 5.1.1 i'll have to see if i can reproduce it on a clean project.
d
I get this often -- pretty much every time it ends up being some form of caching -- the problem is finding it without takeing all day. Particularly with included builds or local builds that are resolved via a local repo. First I try to see if there are leftover build runners that got confused and kill them all. Sometimes killing everything running java. In stages of frustration I start clearing out everything I can find and then some rootProject/**/{.gradle,build,out} $HOME/.m2/... /tmp/*anything gradle or kotlin looking* $HOME/.gradle/ Anything 'cachy' looking then to top it off force a --refresh-dependencies on every locally built dependency I can find A few times I discovered I was resolving against the CI build server's output using a changing dependency which was pulling down the latest CI build instead of my own. For kotlin specific version issues, the sneakiest ones to fix are related to locally built plugins - doing a gradle depends then checking every single transitive dependency on kotlin can help. Yesterday I discovered I was referencing (unused but referenced) kotlinx.testing version that was out of date Another time it was the kotlin jackson module which hadn't been updated. Last stray -- blow up your computer, get a new one, install everything from source and rebuild one by one Its amazing how many things dont build anymore 🙂
m
i definitely think it is an intellij problem - taking the single module and creating a new intellij project from just that module seems to work, but the multi-module intellij projcet still is messed up ¯\_(ツ)_/¯
d
Have you recreated a new multi-module from sratch (after deleting the .idea directory ?) I agree its a intellij problem -- but exactly where ? Intellij + gradle have some very subtle interactions Another issue Ive seen is if I allow modules to be built in parallel in IntelliJ then they can get permentently out of wack -- Its acting like it is not noticing that it needs to refresh its cache of the dependant module after a failure. so keeps re-using the same stale data.
m
yeah it seems something like that im going to try and get a small test case this weekend, but for me i see this happening 1) import a gradle project (
5.1.1
) with
buildSrc
and plugins and other stuff - intellij happy 2) import another gradle project, this time being
5.0
with
buildSrc
and plugins and other stuff - intellij still seems happy, but
build.gradle.kts
go-to-source linking goes to
5.0
now instead of
5.1.1
3) upon restarting intellij, some things in
5.1.1
project are red and unhappy