*[Unsolved]* I’m upgrading a project from 1.3.61 t...
# announcements
r
[Unsolved] I’m upgrading a project from 1.3.61 to 1.4.10 and IDEA keeps saying that Kotlin isn’t configured in my buildSrc sources, what should I do ?
image.png
buildSrc/build.gradle.kts
n
what does
kotlin-dsl
do?
normally you do one of the things documented here
r
You used to need to use this plugin in the buildSrc gradle file to use .gradle.kts files I think, not sure. Maybe it’s no longer needed ? I never had to setup the normal kotlin plugin in there, why would that change ?
n
ah, I didn't notice that. I dunno, worth a shot
r
Removing
kotlin-dsl
completely breaks the usage of the content of buildSrc in other gradle build files.
Adding the kotlin plugin in addition to kotlin-dsl as shown in your link also breaks everything
image.png
l
@ribesg Do you have a "hack" that forces Kotlin version to what you pick against the default for Gradle's
kotlin-dsl
?
r
Do you mean that it’s maybe using version 1.3.72 of the
kotlin-dsl
plugin? As I’m using Gradle 6.6.1 ? I actually don’t know how that version is chosen here so I guess it uses the Gradle one. It still compiles though, maybe it’s a compatibility problem with the Kotlin 1.4 IDEA plugin
l
I personally ensure I use the dependencies I need for my code in `buildSrc`:
Copy code
implementation("com.android.tools.build:gradle:WHATEVER")
    implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.0")
    implementation("org.jetbrains.kotlin:kotlin-compiler-embeddable:1.4.0")
If that doesn't help, I can link you an open source project built on 1.4 to try it out and see if this issue is project scoped or not.
r
That does not seem to help
I also see this when compiling directly from command line with Gradle:
Sans_titre.txt
I tried cleaning EVERYTHING (invalidated IDEA cache, stopped IDEA, ran gradle --stop, deleted every build/.gradle/.idea folders, iml files, I even removed my .m2 and .gradle in ~, then build the project in commandline using the wrapper which has the correct 6.6.1 version) then opened the project in IDEA. After indexing and sync, same issue. Something really isn’t working it’s not about caches or anything like that for me.
n
might just be broken. might have wider visibility posting on the forum
l
@ribesg Can you try with the develop branch of Splitties after you've downgraded AGP in
versions.properties
to a value supported by IDEA (since it uses AGP 4.1 RC), and check if
buildSrc
has all its references resolved there?
s
@ribesg everything? 🙂
r
@louiscad I’m not sure what you mean, which version of AGP should I change? The IDE one or project one? Also there’s no versions.properties file @stephanmg yes wdym?
l
@ribesg If you try with the Splitties project on the develop branch to see if it works, you need to change the AGP version defined in the
versions.properties
file.
✔️ 1
r
@louiscad
Copy code
ribesg:Splitties/ (develop) $ find . | grep versions.properties
ribesg:Splitties/ (develop) $
l
Is it up to date?
r
git says it is, I don’t get it. I’ll remove it and reclone
s
did you check the branch?
l
@ribesg Was it a fork not in sync with the upstream?
✔️ 1
r
@louiscad pretty sure it was but recloned anyway
l
Now you're at Gradle sync, right? 😅
s
well, if it was uptodate the file must exist
r
I set the AGP version to 4.0.0 and it’s syncing/compiling 🙂
(My own project which I’m updating takes 15min to compile soooooo it’s ok)
l
And you can see
buildSrc
work in the IDE?
r
Not yet no
l
I think you use Splitties in your project, and Splitties Views DSL in it, right?
r
Not this one, this is our “Kommon” project, which contains a bunch of stuff, mostly common little tools like KMP uuids and dates and stuff, and also KMP models and clients for all our backend stuff. This Kommon project is used in backend projects, android projects and ios projects. It uses Splitties for appCtx somewhere I think but that’s it. And right now I’m working on a 100% Kotlin iOS (both iPhone & iPad) app, which will be the fun part to update to Kotlin 1.4 I think
(It’s been syncing for 9min now 🙂 )
😴 1
s
grab a coffee 😛
r
I don’t do drugs 😛
s
lol
nvm, then just wait or so
l
I don't do drugs 😛
I'd say something with beers, but I don't do these drugs either 😁
r
BUILD SUCCESSFUL in 12m 33s
Ok now IDEA started indexing the entire internet I think
Aaaaaaaaaaaand boom
Same issue, so is my IDEA installation borked or what?
l
@ribesg Okay. Would you try with AS 4.2 Canary 10 and the AGP on the develop branch (4.1.0-rc02 IIRC)?
r
Ok, updating my absolutely-never-used AS installation from release to canary
l
I always use Android Studio for Android projects personally, and I'm rarlely on a stable release (but rarely the early canaries as they tend to break stuff I need to have working)
r
I don’t think I’m making my backend guys install AS 😅
l
Ah I see… let's see if it works here at least, then we can talk about solutions be it me making your backend guys use AS or you fixing or working around the issues you have in IDEA 😄
r
These issues were not here before, so I could potentially rollback something to a previous version I think? We’ll see
AS indexing the planet too like IDEA did
@louiscad so after 10min of indexing it seems to work correctly in AS I don’t see any error in the buildSrc
👌 1
l
Great! Which IDEA version do you use exactly?
r
The latest release version which is
2020.2.1
Do you think I’ll have more luck with 2020.2.2 RC ?
l
You might. But you'll need to revert to AGP 4.0.1
r
Looks like 2020.2.2 RC works. Maybe the problem comes from something I didn’t cleaned up that stays stored in the IDEA folder or something. I should probably try to just uninstall and remove IDEA entirely and reinstall a fresh version but maybe later
Thanks for the help @louiscad
l
You're welcome. @ribesg BTW, #CHJP9K00L just got a new release with iOS/macOS/watchOS stuff (compatible with Kotlin 1.4), and Views DSL updates among other things. Feel free to try it when it's the time 🙂
👀 1