https://kotlinlang.org logo
#compose-ios
Title
# compose-ios
s

Stanislav Radchenko

06/19/2023, 9:07 AM
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

a-dd

06/19/2023, 11:04 AM
Hi, could you share a full stacktrace and a version of Kotlin you’re using?
s

Stanislav Radchenko

06/19/2023, 11:09 AM
log.txt
Kotlin version : 1.8.20
a

a-dd

06/19/2023, 11:20 AM
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

Stanislav Radchenko

06/19/2023, 11:21 AM
I think deal in my
buildSrc
. I'm trying to implement this structure:
a

a-dd

06/19/2023, 11:29 AM
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

Stanislav Radchenko

06/19/2023, 11:33 AM
a

a-dd

06/19/2023, 11:54 AM
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

Stanislav Radchenko

06/19/2023, 12:02 PM
Ok, I will check later and create issue
a

a-dd

06/19/2023, 2:58 PM
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

Ahmed Elzeiny

07/26/2023, 8:20 PM
@a-dd any thoughts on this
24 Views