iamsteveholmes
07/29/2021, 7:13 PMiosApp.swift
class with:
import SwiftUI
@main
struct iOSApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
Instead of the whole AppDelegate and SceneDelegate thing. Being new to IOS and swift entirely I know very little except the new way seems WAY simpler and maybe more versatile and configurable to create multiple scenes, etc. Has anyone converted from the old way to the new way?MJegorovas
07/30/2021, 12:28 PMException in thread "main" java.lang.IllegalStateException: Could not find 'libCryptoKitWrapper.a' binary in neither of [CryptoKitWrapper/build/Release-iphoneos]
even though the file is present in the location. Any ideas what might be wrong?Simonas Brazauskas
07/30/2021, 1:10 PMabstract class KotlinAbstractClass : KotlinInterface {
}
interface KotlinInterface {
fun testFunction()
}
//Swift code
class SwiftClass : KotlinAbstractClass {
}
XCode compiles SwiftClass
successfully, but then fails with an exception at runtime if someone tries to call SwiftClass::testFunction
.
Is this a bug or works as intended? We are having some issues with ios devs, as sometimes they forget to implement all interface methods, which results in crashes. Also it would cause issues, when additional methods in interfaces are added.Lena Stepanova
07/30/2021, 2:20 PMtylerwilson
07/30/2021, 2:46 PMval kotlinVersion = "1.5.21"
val coroutinesVersion = "1.5.0-native-mt"
val ktorVersion = "1.6.1"
val serializationVersion = "1.2.1"
if i try to update any of them (1.5.1-native-mt, 1.6.2 or 1.2.2), then the linkDebugFrame taks will either fail silently (create an empty klib folder) or spit out the error below, depending on the target (I have it set up for android, jvm, ios, watchos and macos). Using latest AS Arctic Fox with latet Kotlin 1.5.21 plugin.
w: skipping /Users/tylerwilson/.gradle/caches/modules-2/files-2.1/io.ktor/ktor-client-serialization-iosx64/1.6.2/681f93a891846267e5050007bc41a01e459dbe74/ktor-client-serialization.klib. Incompatible abi version. The current default is '1.4.2', found '1.5.0'. The library produced by 1.5.20 compiler
e: Could not find "/Users/tylerwilson/.gradle/caches/modules-2/files-2.1/io.ktor/ktor-client-serialization-iosx64/1.6.2/681f93a891846267e5050007bc41a01e459dbe74/ktor-client-serialization.klib" in [/Users/tylerwilson/Projects/salonbiz-stylist-android, /Users/tylerwilson/.konan/klib, /Users/tylerwilson/.konan/kotlin-native-prebuilt-macos-1.5.10/klib/common, /Users/tylerwilson/.konan/kotlin-native-prebuilt-macos-1.5.10/klib/platform/ios_x64]
Can anybody help????Landry Norris
07/30/2021, 3:41 PMNacho Ruiz Martin
07/30/2021, 5:59 PMMichal Harakal
07/30/2021, 7:37 PMEric O'Connell
07/30/2021, 8:03 PMKotlin doesn’t currently support sharing a source set for these combinations:
…
JVM + Android targetsIs this limitation expected to remain for a while?
Landry Norris
07/30/2021, 9:43 PMBradford Canonigo
07/30/2021, 11:58 PMaiidziis
07/31/2021, 8:04 AMNacho Ruiz Martin
07/31/2021, 8:01 PMDaniel Kunis [JB]
08/02/2021, 11:17 AMAlexander Ignatiev
08/02/2021, 11:47 AMStefan Oltmann
08/02/2021, 3:47 PMZahn
08/02/2021, 6:24 PMiosArm64("ios")
?
Task 'embedAndSignAppleFrameworkForXcode' not found in project ':common'.
Evan
08/02/2021, 9:10 PMcoolcat
08/03/2021, 8:02 AM2021-08-02T22:52:01.227+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2021-08-02T22:52:01.228+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2021-08-02T22:52:01.230+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2021-08-02T22:52:01.230+0100 [DEBUG] [org.gradle.internal.remote.internal.inet.TcpOutgoingConnector] Attempting to connect to [77b233a7-ef8c-4285-9d34-29b590570f08 port:61870, addresses:[/127.0.0.1]].
2021-08-02T22:52:01.230+0100 [DEBUG] [org.gradle.internal.remote.internal.inet.TcpOutgoingConnector] Trying to connect to address /127.0.0.1.
2021-08-02T22:52:01.234+0100 [DEBUG] [org.gradle.internal.remote.internal.inet.TcpOutgoingConnector] Connected to address /127.0.0.1:61870.
Does anybody have any hints for troubleshooting? I already tried setting
-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs=-Xmx2g
as my GRADLE_OPTS
env variable.Landry Norris
08/03/2021, 2:29 PMMichal Klimczak
08/03/2021, 4:12 PMdelegates
in ios are weak. You need to keep a strong reference somewhere for them to not get deallocated unexpectedly. This is even more problematic, because usually the problem doesn't manifest itself on debug build, only release build crash and the stacktrace is rubbish.mike.holler
08/03/2021, 7:46 PMError_0: Fail to fetch
Error_0: Fail to fetch
at _no_name_provided__246.invoke_1ti8hr(kotlin/multiplatform-sdk-end-to-end-tests-test.js:69724)
at <global>.<unknown>(/home/mjholler/Git/multiplatform-sdk/build/js/packages/multiplatform-sdk-end-to-end-tests-test/kotlin/multiplatform-sdk-end-to-end-tests-test.js:69752)
at <global>.processTicksAndRejections(internal/process/task_queues.js:93)
Ngenge Senior
08/04/2021, 2:19 AMFanis Paschos
08/04/2021, 6:00 AMCdev
08/04/2021, 5:02 PMval buildXcFramework by tasks.registering {
dependsOn("deleteXcFramework")
group = "build"
val mode = "Release"
val frameworks = arrayOf("iosArm64", "iosX64", "iosArm32")
.map { kotlin.targets.getByName<KotlinNativeTarget>(it).binaries.getFramework(mode) }
inputs.property("mode", mode)
dependsOn(frameworks.map { it.linkTask })
doLast { buildXcFramework(frameworks) }
}
Raul Macías
08/05/2021, 11:23 AMKareem Waleed
08/05/2021, 2:36 PMKMM
to be stable and ready for production ?Akram Bensalem
08/05/2021, 3:00 PMMarko Novakovic
08/05/2021, 3:11 PMCdev
08/05/2021, 5:48 PMimport org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
plugins {
kotlin("multiplatform")
kotlin("plugin.serialization")
id("com.android.library")
}
val iOSProjectName = "MBKMMShared"
val xcFrameworkPath = "xcframework/" + iOSProjectName + ".xcframework"
tasks.create<Delete>("deleteXcFramework") { delete = setOf(xcFrameworkPath) }
kotlin {
val serializationVersion = "1.1.0"
val koTestVersion = "4.4.3"
android()
iosArm32()
ios {
binaries {
framework {
baseName = "MBKMMShared"
}
}
}
sourceSets {
val commonMain by getting {
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$serializationVersion")
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
implementation("io.kotest:kotest-property:$koTestVersion")
implementation("io.kotest:kotest-assertions-core:$koTestVersion")
}
}
val androidMain by getting
val androidTest by getting {
dependencies {
implementation(kotlin("test-junit"))
implementation("junit:junit:4.13")
}
}
//val iosMain by getting
val iosTest by getting
val iosX64Main by sourceSets.getting
val iosArm64Main by sourceSets.getting
val iosArm32Main by sourceSets.getting
val iosMain by sourceSets.getting {
dependsOn(commonMain)
iosX64Main.dependsOn(this)
iosArm64Main.dependsOn(this)
iosArm32Main.dependsOn(this)
}
}
}
android {
compileSdkVersion(30)
defaultConfig {
minSdkVersion(21)
targetSdkVersion(30)
}
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
}
val packForXcode by tasks.creating(Sync::class) {
group = "build"
val mode = System.getenv("CONFIGURATION") ?: "RELEASE" // TODO Fix before release
val sdkName = System.getenv("SDK_NAME") ?: "iphonesimulator"
val targetName = "ios" + if (sdkName.startsWith("iphoneos")) "Arm64" else "X64"
val framework =
kotlin.targets.getByName<KotlinNativeTarget>(targetName).binaries.getFramework(mode)
inputs.property("mode", mode)
dependsOn(framework.linkTask)
val targetDir = File(projectDir, "xcode-frameworks")
from({ framework.outputDirectory })
into(targetDir)
}
tasks.getByName("build").dependsOn(packForXcode)
fun Task.buildXcFramework(frameworks: List<org.jetbrains.kotlin.gradle.plugin.mpp.Framework>) {
val buildArgs: () -> List<String> = {
val arguments = mutableListOf("-create-xcframework")
frameworks.forEach {
arguments += "-framework"
arguments += "${it.outputDirectory}/" + iOSProjectName + ".framework"
}
arguments += "-output"
arguments += xcFrameworkPath
arguments
}
exec {
executable = "xcodebuild"
args = buildArgs()
}
}
val buildXcFramework by tasks.registering {
dependsOn("deleteXcFramework")
group = "build"
val mode = "Release"
val frameworks = arrayOf("iosArm32", "iosArm64", "iosX64")
.map { kotlin.targets.getByName<KotlinNativeTarget>(it).binaries.getFramework(mode) }
inputs.property("mode", mode)
dependsOn(frameworks.map { it.linkTask })
doLast { buildXcFramework(frameworks) }
}