This works <https://github.com/kotlin-hands-on/kmm...
# squarelibraries
c
This works https://github.com/kotlin-hands-on/kmm-networking-and-data-storage/tree/final so I’m stripping it for parts until mine work
r
Yeah it sucks when something that seems like it should be so basic doesn't seem to work... keep at it though, it definitely does! One more thing for you to check... Do you have
kotlin.mpp.enableGranularSourceSetsMetadata=true
set in your
gradle.properties
?
c
unfortunately I do
r
Sorry 😞 What version of Gradle?
c
I downgraded to 4.1.1
the thing that drives me crazy is to create a fresh app with the wizard and not be andle to add the library
r
Why did you downgrade gradle? MPP requires Gradle 6 or later IIRC.
c
So a freshly created app with the wizard wouldn’t work out of the box?
r
One would think so, but all this stuff is so new I wouldn't be completely surprised if the wizard hasn't been updated to the latest instructions.
c
What is sort of weird is that I was testing this on my main project 2 days ago and now it doesn’t work at all anymore
r
Did you downgrade Gradle in that project?
c
Not at all, I was actually looking into my git to check if there was any changes in my build gradle and nothing
r
I'm assuming you checked all the diffs, not just the build file? The properties and settings files can affect things too. As well as gradle settings in your home directory.
c
Copy code
dependencies {
    classpath( "com.android.tools.build:gradle:4.0.1")
    classpath( "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version")
    classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$graddle")
    classpath("com.android.tools.build:gradle:4.1.1")
    classpath("org.jetbrains.kotlin:kotlin-serialization:$kotlinVersion")
    classpath( "com.google.gms:google-services:4.3.4")
}
My dependencies on my main project for the last 2 weeks
I was actually sorting an issue in the UI, barely touched my config files
r
What is
$graddle
? That seems suspicious. It should be a Kotlin version there, not anything related to Gradle.
c
Copy code
val graddle = "1.4.10"
val kotlinVersion = "1.4.0"
val nav_version = "2.3.0"
I leave it outside
so it can play with the other variables
r
Weirdly named variable. And that isn't the right way to do the serialization plugin any more either. You should be using:
kotlin("plugin.serialization") version "1.4.10"
in the plugins block of your shared library.
c
hm
You mean here
Copy code
plugins {
    kotlin("multiplatform")
    kotlin("plugin.serialization")
    id("com.android.library")
    id("kotlin-android-extensions")
    id("com.squareup.sqldelight")
}
?
r
Yup
c
Dman, that’s good to know
maybe if I put the sql delight version there it will work
r
I also have
kotlin("native.cocoapods")
in that list... you'll want that if you need to depend on any cocoapods in your iosMain.
I don't have a version there for sqldelight
I do for the serialization plugin though. Might not be needed though.
c
Can you share the place that shows how to do this?
I mean, where did you learn to do:
kotlin("plugin.serialization") version "1.4.10"
gradle docs?
c
Very helpful
I don’t fucking believe that this was the issue
with the sql delight
r
That does seem odd, but I guess when you mess with the classpath things can get real wonky real fast
c
😓
r
It might have something to do with which classloader the kotlin compiler ends up in.