https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
k

Kris Wong

05/20/2019, 6:55 PM
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

tylerwilson

05/20/2019, 10:41 PM
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

Kris Wong

05/20/2019, 10:55 PM
in my case idea highlights the hell out of build.gradle with warnings and errors
i just had to get used to it
t

tylerwilson

05/20/2019, 10:56 PM
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

Kris Wong

05/20/2019, 10:57 PM
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

tylerwilson

05/20/2019, 10:59 PM
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

Kris Wong

05/20/2019, 11:00 PM
welcome to the bleeding edge
t

tylerwilson

05/20/2019, 11:00 PM
i feel bled out
🙂
k

Kris Wong

05/20/2019, 11:00 PM
the alternative is wait for stable
t

tylerwilson

05/20/2019, 11:01 PM
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

Kris Wong

05/21/2019, 12:11 AM
The source sets have to match your target names. Also, cocoapods integration is built in with 1.3.30.
It's pretty nifty
t

tylerwilson

05/21/2019, 12:12 AM
is that doc-ed anywhere?
k

Kris Wong

05/21/2019, 12:18 AM
Yeah Google kotlin cocoapods and I'm sure it will pop up
t

tylerwilson

05/21/2019, 1:37 AM
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

Kris Wong

05/21/2019, 4:10 PM
Copy code
binaries {
                    framework("$ios_framework_name")
                }
it will end up creating 4 frameworks, but it will be named properly
2 Views