have anyone received this error trying to build a ...
# multiplatform
k
have anyone received this error trying to build a fat framework: Could not get unknown property 'FatFrameworkTask' for object of type org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension?
gah! easy to miss that import statement at the top of the code sample 🤦
t
Do you get this too when using it: it shows as unresolvable, but it does build. Disconcerting to see anything in red in the IDE (IntelliJ IDEA Community in my case).
k
in my case idea highlights the hell out of build.gradle with warnings and errors
i just had to get used to it
t
in the case of using the FatFramework, what do you have for your sourcesets for iOS. the docs do not include this case, and I keep going round and round?
k
Copy code
iosMain {}
        iosX64Main {
            dependsOn iosMain
        }
        iosArm64Main {
            dependsOn iosMain
        }
        iosArm32Main {
            dependsOn iosMain
        }
you can also specify that in the
targets
block using the
sourceSets
property
t
cool, that is better. there ought to be a shorter version like listOf(iosX64Main,…) but this works. It is frustrating having to become a gradle groovy expert to get a build set up…
k
welcome to the bleeding edge
t
i feel bled out
🙂
k
the alternative is wait for stable
t
So now I get this:
Copy code
The following Kotlin source sets were configured but not added to any Kotlin compilation:
 * iosArm32Main
 * iosArm64Main
 * iosTest
and the build fails.
back to basics.
btw, have you tried this one? https://github.com/AlecStrong/kotlin-native-cocoapods looks promising, but fails for me with some odd error.
k
The source sets have to match your target names. Also, cocoapods integration is built in with 1.3.30.
It's pretty nifty
t
is that doc-ed anywhere?
k
Yeah Google kotlin cocoapods and I'm sure it will pop up
t
Got it. Thanks!
Got the built-in cocoapods podspec working, but do you know how to set the basename of the generated framework/classes?
Never mind. Found the answer is not supported. 😞
k
Copy code
binaries {
                    framework("$ios_framework_name")
                }
it will end up creating 4 frameworks, but it will be named properly