rohith
02/03/2022, 6:51 PMJeanne De ArcRuler
02/04/2022, 1:16 AMdimsuz
02/04/2022, 1:59 PMsealed class Product { // OK
sealed class Card : Product() { // OK
data class CreditCard(...): Card() // Inacessible from swift
}
}
The problem is that CreditCard
is not visible from Swift code, while its parents are visible.
Is this a known problem? Are there any workarounds?Felipe Sáez
02/04/2022, 2:49 PMpodspec
is created which generates a podpsec
file which points to a .framework
file located in build/cocoapods/framework/shared.framework
. Even though it’s mentioned there that an XCFramework is built, I don’t know what gradle task we are supposed to run. When running ./gradlew tasks --all
I don’t see any XCFramework related task. So here some questions about the CocoaPods integration:
a. What’s the right way to get a framework that can be used for production considering that I won’t release an app but a framework and that I want to include multiple architecture slices (iOS simulator, iOS device, tvOS simulator, tvOS device)?
b. Is it possible to get an XCFramework only using the CocoaPods integration?
2. On the other hand, when choosing XCFramework from the wizard only Debug
and Release
build types/configurations are available and there doesn’t seem to be an option to add more. Here some questions regarding the XCFramework integration:
a. What’s the right way to work for development? Do we need to generate a new XCFramework every time we make a change?
b. If the existing framework does not exclude i386 architecture, I will get an error regarding this missing architecture. Does KMM not support i386? The existing framework supports iOS 9 which apparently seems to force the i386 architecture. The architectures property in build settings is set to standard (ARCHS = “$(ARCHS_STANDARD)“).
Maybe the right setup should combine both? If so what would be the right way to do this?
I’ve tried quite a few different approaches and the best I’ve found so far is to use the org.jetbrains.kotlin.gradle.plugin.mpp.apple.XCFramework
function/initializer which doesn’t allow me to use custom build configurations (Test, Preprod). Neither does the XCFrameworkConfig
class.
I hope I’m being clear and I hope to be asking the right questions.
Have a great weekend.
Cheersgrahamborland
02/04/2022, 5:32 PM.js
and .js.map
files to the distribution directory, but not the .d.ts
file. Is there a way to get that file included too?Matthew Kruk
02/04/2022, 5:50 PMJustin Xu
02/05/2022, 2:02 AM'pod install' command failed with an exception:
Cannot run program "pod" (in directory "...../iosApp"): error=2, No such file or directory
I installed cocoapods using ruby2.7.5, and I am on M1 mac, following the troubleshooting guide here. My “pod install” command also works in the folder, I am just not sure why this error keeps showing up.Gillian Buijs
02/05/2022, 12:52 PMtheapache64
02/05/2022, 3:32 PMPeter Hsu
02/06/2022, 6:30 AMkhairil.ushan
02/06/2022, 9:23 AMTask 'embedAndSignAppleFrameworkForXcode' not found in project ':shared'.
I am working with M1 Pro machine. After google a little bit, Seems like I have to run the Xcode using Rosetta and update the Build Setting of the iOS project to exclude arm64
then I can run the iOS app via Xcode. But I still can't run it using Android Studio due to the same error.
So, is that the only workaround to be able to developing KMM app using M1 ?
And, when I got Xcode build successfully, why AS still fail to build/run the iOS App?
Thanks everyone, and sorry if this is repeated questions. Feel free to refer me to some previous discussion around this.eygraber
02/07/2022, 6:50 AMgpaligot
02/07/2022, 1:44 PMdata class AgendaUi(val talks: Map<String, List<TalkItemUi>>)
And I have a fake data in Kotlin too:
val fakeAgendaUi = AgendaUi(
talks = mapOf(
"10:00" to arrayListOf(fakeTalkItem, fakeTalkItem),
"11:00" to arrayListOf(fakeTalkItem, fakeTalkItem),
"12:00" to arrayListOf(fakeTalkItem, fakeTalkItem),
),
)
The usage of this fake data work fine on Android but when I use this fake data instance on iOS, I receive a Dictionary with the good key and a list of two NSNull
elements. But if I create the fake data in Swift, everything work fine:
let agenda = AgendaUi(
talks: [
"10:00": [TalkItemUiKt.fakeTalkItem, TalkItemUiKt.fakeTalkItem],
"11:00": [TalkItemUiKt.fakeTalkItem, TalkItemUiKt.fakeTalkItem],
"12:00": [TalkItemUiKt.fakeTalkItem, TalkItemUiKt.fakeTalkItem],
"13:00": [TalkItemUiKt.fakeTalkItem, TalkItemUiKt.fakeTalkItem],
]
)
Somebody know why? A bug in interoperability maybe?Michael Paus
02/07/2022, 4:33 PMAlen Kirm
02/07/2022, 4:56 PMKtor 1.6.7
and Coroutines 1.5.1-new-mm-dev2
but ./gradlew <module>:compileKotlinMetadata
gradle tasks are failing.Igor Milakovic
02/07/2022, 7:07 PMshared
module internal
by default?
I would like to expose use case interfaces only to my iosApp
and androidApp
, as they have no business instantiating anything else from the shared module.Tony Kazanjian
02/07/2022, 10:28 PMArkadii Ivanov
02/08/2022, 11:26 AMTask 'embedAndSignAppleFrameworkForXcode' not found in project '😒ample:todo-darwin-umbrella'.I already checked KT-49637 and KT-47077 which look similar to my problem, but nothing was helpful. I'm using Kotlin 1.6.10 and I have
iosSimulatorArm64
target configured.
I have the following Java version installed locally: 15.0.6 (arm64) "Azul Systems, Inc." - "Zulu 15.38.17"
Also I noticed that there are Gradle tasks linkDebugFrameworkIosArm64
and linkDebugFrameworkIosX64
, but there is no Gradle task like linkDebugFrameworkIosSimulatorArm64
, only linkDebugTestIosSimulatorArm64
which seems irrelevant.
Running the Xcode in Rosetta mode fixes the build, but I would like avoid Rosetta if possible. Are there any ideas of how I could fix the issue?Stylianos Gakis
02/08/2022, 4:28 PMVivek Modi
02/08/2022, 5:41 PMelectrolobzik
02/08/2022, 5:54 PM<https://play.kotlinlang.org/hands-on/Full%20Stack%20Web%20App%20with%20Kotlin%20Multiplatform>
I get this error: The Compose Compiler requires the Compose Runtime to be on the class path, but none could be found
while compiling jvm target. I have compose dependencies specified only for js target, but it looks like the Compose Plugin is used for jvm and it causes the error. How could I fix that? Are there any sample projects with Compose and Ktor backend working together?Lukasz Burcon
02/08/2022, 6:14 PMelectrolobzik
02/08/2022, 6:44 PMapplication {
mainClass.set("com.example.ApplicationKt")
}
for jvm target when I use multiplatform setup? I get this error: Error running 'ApplicationKt': Class 'com.example.ApplicationKt' not found in module 'com.example.main'
xxfast
02/08/2022, 10:27 PMcommonMain
openApiGenerate {
generatorName.set("kotlin")
library.set("multiplatform")
...
}
By default this task doesn’t dependOn
to run before any build task, so I had to manually do so
tasks.preBuild { dependsOn(tasks.openApiGenerate) }
This works for android
, but for desktop i had to do
tasks.named("compileKotlinDesktop") { dependsOn(tasks.openApiGenerate) }
so forth for all other targets. Is there a common task that I can hook on to instead?kierans777
02/09/2022, 1:42 AM> Task :my-library:linkDebugTestIosX64 FAILED
e: Could not find "io.kotest:kotest-assertions-api" in [
/Users/kieran/Projects/my-library/kotlin,
/Users/kieran/.konan/klib,
/Users/kieran/.konan/kotlin-native-prebuilt-macos-x86_64-1.6.0/klib/common,
/Users/kieran/.konan/kotlin-native-prebuilt-macos-x86_64-1.6.0/klib/platform/ios_x64
]
FAILURE: Build failed with an exception.
// arrowVersion = 1.0.1
commonMain {
dependencies {
api "io.arrow-kt:arrow-core:${rootProject.ext.arrowVersion}"
api "io.arrow-kt:arrow-fx-coroutines:${rootProject.ext.arrowVersion}"
}
}
// kotestVersion = "5.1.0"
commonTest {
dependencies {
implementation "io.kotest:kotest-framework-engine:${rootProject.ext.kotestVersion}"
implementation "io.kotest:kotest-assertions-core:${rootProject.ext.kotestVersion}"
implementation "io.kotest:kotest-property:${rootProject.ext.kotestVersion}"
implementation "io.kotest.extensions:kotest-assertions-arrow:1.2.2"
}
}
If I look on my disk the files are present (the .a
files are present, I've reduced the amount of output)
$ find ~/.konan/ -name '*assertions-api*'
/Users/kieran/.konan/kotlin-native-prebuilt-macos-x86_64-1.6.0/klib/cache/ios_x64-gSTATIC/kotest-assertions-api-iosx64
$ find ~/.konan/ -name '*arrow*'
/Users/kieran/.konan/kotlin-native-prebuilt-macos-x86_64-1.6.0/klib/cache/ios_x64-gSTATIC/kotest-assertions-arrow-iosx64
/Users/kieran/.konan/kotlin-native-prebuilt-macos-x86_64-1.6.0/klib/cache/ios_x64-gSTATIC/arrow-core-iosx64
So the main linking step can find Arrow, but the test linking can't find the kotest-assertions-api
. Has anyone else had this sort of problem?julien hamon
02/09/2022, 5:04 AMiosTarget("ios") { }
cocoapods {
summary = "Some description for the Shared Module"
homepage = "Link to the Shared Module homepage"
ios.deploymentTarget = "14.1"
frameworkName = "shared"
podfile = project.file("../iosApp/Podfile")
framework {
isStatic = false
transitiveExport = true
}
pod ("AlgoliaSearchClient")
}
actual in iOS main:
import cocoapods.AlgoliaSearchClient.*
actual interface SearchApi {
actual fun search(words: String): List<Training> {
val search = ClientSearch()
return listOf(Training(id = "1", name = "name1"), Training(id = "2", name = "name2"))
}
}
vincentm
02/09/2022, 9:33 AMandroidTest {
dependsOn(commonTest)
dependencies {
implementation("io.mockk:mockk:$mockkVersion") // <-- this dependency is also added to the `androidAndroidTest` source set
}
}
androidAndroidTest {
dependsOn(commonTest)
dependencies {
implementation("io.mockk:mockk-android:$mockkVersion")
}
}
For an unknown reason, my dep io.mockk:mockk
is also added to the androidAndroidTest
source set.electrolobzik
02/09/2022, 12:16 PMkotlin {
jvm {
withJava()
}
sourceSets {
val jvmMain by getting {
dependencies {
...
}
}
}
}
and don’t see resource files from src/jvmMain/resources
in class path after project was built. What I am doing wrong and how could I get resources in my class path? P.S. I see resources in the processedResources
folder, so they are processed somehow. But for some reason not put in the result folder (classes/kotlin/jvm/main/META-INF
)Siggi Gunnarss
02/09/2022, 3:58 PMembedAndSignAppleFrameworkForXcode
speeds things up but that doesn't work with making ios archives (?).
Has anyone here included embedAndSignAppleFrameworkForXcode
in a development proces where it's easy to switch between compiling kotlin locally and using some precompiled artifact (XCFramework, cocoapod)?Siggi Gunnarss
02/09/2022, 3:58 PMembedAndSignAppleFrameworkForXcode
speeds things up but that doesn't work with making ios archives (?).
Has anyone here included embedAndSignAppleFrameworkForXcode
in a development proces where it's easy to switch between compiling kotlin locally and using some precompiled artifact (XCFramework, cocoapod)?Viacheslav Kormushkin
02/09/2022, 4:20 PMembedAndSignAppleFrameworkForXcode
not working with iOS archives? Do you mean there are some problems with archiving iOS app for distribution?Sam
02/10/2022, 3:12 AMSiggi Gunnarss
02/10/2022, 10:02 AMViacheslav Kormushkin
02/10/2022, 12:47 PMSiggi Gunnarss
02/10/2022, 5:34 PM