Hi, I'm trying to add a library to cocoapods confi...
# compose-ios
s
Hi, I'm trying to add a library to cocoapods configuration in Kotlin:
Copy code
cocoapods {
        version = "1.0.0"
        summary = "Compose application framework"
        homepage = "{SOME_VALUE}"
        ios.deploymentTarget = "11.0"
        podfile = project.file("../iosApp/Podfile")
        framework {
            baseName = "ComposeApp"
            isStatic = true
        }
        pod("GoogleSignIn") // This crash sync of project
    }
I'm getting this error:
void org.jetbrains.kotlin.gradle.plugin.cocoapods.CocoapodsExtension.pod$default(org.jetbrains.kotlin.gradle.plugin.cocoapods.CocoapodsExtension, java.lang.String, java.lang.String, <http://java.io|java.io>.File, java.lang.String, java.lang.String, int, java.lang.Object)
If I delete `pod("GoogleSignIn")`` gradle is successfully synchronized
👍 1
a
Hi, could you share a full stacktrace and a version of Kotlin you’re using?
s
log.txt
Kotlin version : 1.8.20
a
I can’t reproduce it 😞 This pod imports successfully together with a compose plugin (I’ve used this project as a template https://github.com/JetBrains/compose-multiplatform-ios-android-template) Could you try working out a minimal reproducer project?
s
I think deal in my
buildSrc
. I'm trying to implement this structure:
a
Well, then I must see a code inside buildSrc that calls the cocoapods plugin 🙂 But wild guess — inside buildSrc there is a different kotlin version (that is bundled inside Gradle)
s
a
You can work around the issue by adding curly brackets, like this
pod("GoogleSignIn") {}
Could you open an issue about this case here https://kotl.in/issue?
s
Ok, I will check later and create issue
a
After some digging I think now it’s not an issue of Kotlin. You have
kotlin-gradle-plugin
1.8.20 in your build classpath when compiling build scripts but build executes with 1.8.10. Because of that binary incompatibility happens in the builds’s runtime. It probably happens due to double-nested
buildSrc
I’m not sure whether if it is a Gradle’s bug or expected behaviour but from Kotlin side it’s expected. You can check it through
./gradlew buildEnv
I highly recommend to use version catalogs for a centralized versions management instead of
buildSrc
.
a
@a-dd any thoughts on this