i am trying to use the new cocoapods plugin with t...
# multiplatform
s
i am trying to use the new cocoapods plugin with the example here https://github.com/JetBrains/kotlin-native/blob/master/samples/cocoapods/kotlin-library/build.gradle.kts. Can anyone help me translate kotlin syntax to groovy? specifically line 22
val iOSMain by sourceSets.creating
i want to keep my build.gradle in groovy, for now
h
The line
Copy code
val iOSMain by sourceSets.creating
is just getting the source set by name. So you can translate it to:
Copy code
def iOSMain = sourceSets.iOSMain
s
thanks! I have a new error now, "Could not get unknown property 'iOSMain' for KotlinSourceSet container of type org.gradle.api.internal.FactoryNamedDomainObjectContainer." when trying to run the pod on xcode (real device) but have no errors when using the sim. I probably misconfigured something somewhere
h
Ah, sorry, it should be
def iOSMain = sourceSets.create('iOSMain')
s
thanks a lot! i got passed the previous errors 🙂
now it still works using the simulator, but when trying to run on an iOS device, it gives me "ld: symbol(s) not found for architecture arm64"
i followed the guide from the cocoapods example: def buildForDevice = project.findProperty("kotlin.native.cocoapods.target") == "ios_arm" if (buildForDevice) { iosArm64("iOS64") iosArm32("iOS32") def iOSMain = sourceSets.create('iOSMain') sourceSets["iOS64Main"].dependsOn(iOSMain) sourceSets["iOS32Main"].dependsOn(iOSMain) } else { iosX64("iOS") }
the only difference is that the i changed one line from kotlin to groovy
weirdly enough, i can archive a build successfully but cannot build for a device 🤔
Sorry for the massive wall of text, turns out clearing derived data was the solution all along!