Mihail Krivov
08/31/2021, 4:40 PMval ios = listOf(iosX64(), iosArm64())
configure(ios) {
binaries{
framework{
baseName = "commonModule"
}
}
}
...
...
val iosX64Main by getting{
dependencies{
...kotlinx-coroutines-core-native:1.3.5
...ktor-client-ios:1.6.1
...sqldelight:native-driver:1.5.0
}
val iosArm64Main by getting{
dependsOn(iosX64Main)
}
OR
ios {
binaries{
framework{
baseName = "commonModule"
}
}
}
val iosMain by getting{
dependencies{
...kotlinx-coroutines-core-native:1.3.5
...ktor-client-ios:1.6.1
...sqldelight:native-driver:1.5.0
}
OR any structure u prefer
And regardless of type u prefer, xCode everytime return error when try to build project
like
task embedAndSignAppleFrameworkForXcode not found
OR
NVActivityIndicatorView not found for target x86_64-apple-ios-simulator
OR
one time I saw error like DatabaseDriverFactory has no dependencies
OR
Execution failed for task "commonModulecompileKotlinIosX64"
OR
etc...
So... can any1 explain me what I need to do?! I feel like a blind kitten and constantly bump into walls 🤕Sam
08/31/2021, 6:34 PMval iosArm64 = iosArm64()
// Uncomment this and add it to the list of iosTargets once libraries catch up and start publishing
// binary artifacts for the ios arm64 simulator.
//val iosArm64Sim = iosSimulatorArm64()
val iosX64 = iosX64()
// Uncomment and add to the list of targets below to add macosX64 targets
//val macosX64 = macosX64()
val darwinTargets = listOf(iosArm64, iosX64)
configure(darwinTargets) {
binaries.framework {
baseName = libName
embedBitcode("bitcode")
export("co.touchlab:kermit:0.1.9")
transitiveExport = true
xcf.add(this)
}
}
Sam
08/31/2021, 6:36 PMval darwinMain by sourceSets.creating {
dependsOn(commonMain)
dependencies {
implementation(libs.ktor.client.ios)
api("co.touchlab:crashkios:${Versions.iOS.crashkios}")
}
}
val iosX64Main by sourceSets.getting {
dependsOn(darwinMain)
}
val iosArm64Main by sourceSets.getting {
dependsOn(darwinMain)
}
// Uncomment when enabling building for macOS.
// val macosX64Main by sourceSets.getting {
// dependsOn(darwinMain)
// }
Sam
08/31/2021, 6:39 PMval packForXcode by tasks.creating(Sync::class) {
// selecting the right configuration for the iOS
// framework depending on the environment
// variables set by Xcode build
val mode = (project.findProperty("XCODE_CONFIGURATION")?.toString()?.toUpperCase()
?: "DEBUG").split("_").first()
if (mode == "DEBUG"){
dependsOn("assembleRoll20CoreDebugXCFramework")
}else {
dependsOn("assembleRoll20CoreReleaseXCFramework")
}
}