• a

    Alberto

    1 year ago
    what’s the recommended way of handling unit tests for classes that may have different way of constructing them on Android/iOS? Example SQLDelight requires an Android Context to be passed to the AndroidSqliteDriver while it’s not used for the NativeSqliteDriver. Is it better to create separate tests for Android module and iOS module, or use the common test module and check at runtime somehow if we’re testing on Android (pass the context then) vs iOS?
    a
    j
    6 replies
    Copy to Clipboard
  • j

    Julius

    1 year ago
    Anyone else having problems using cocoapods in KMM?
    > Task :SharedCode:cinteropAFNetworkingIosX64 FAILED
    Exception in thread "main" java.lang.Error: /var/folders/j7/fqrxk_js0sn4r2blxl4kq0fm0000gn/T/14707145049679086784.m:1:9: fatal error: module 'AFNetworking' not found
    j
    Artyom Degtyarev [JB]
    5 replies
    Copy to Clipboard
  • e

    Evan

    1 year ago
    What’s currently the best approach for writing unit tests for the common module when it comes to mocking frameworks? I see that
    MockK
    has a
    mockk-common
    module now. However KampKit is using
    Karmok
    which doesn’t look like it’s been updated in a while.
    e
    1 replies
    Copy to Clipboard
  • Before Old

    Before Old

    1 year ago
    Hi there, my team is new to kmm, have a question about publishing a kmm framework from ios side. if we want to track the uncaught exception trace of kotlin, do we have to publish a debug framework instead of a release one? (we have read issues and docuement about this, not so sure) https://github.com/JetBrains/kotlin-native/issues/2600 https://kotlinlang.org/docs/native-ios-symbolication.html
    Before Old
    1 replies
    Copy to Clipboard
  • Artyom Degtyarev [JB]

    Artyom Degtyarev [JB]

    1 year ago
    Hello everyone! Some time ago, I posted a call for an interview. It can be found here. I want to talk about the linuxX64 target usage across Kotlin Multiplatform projects. If you would like to participate in an interview about ~30 minutes long, please send me a DM or use the 🙋 reaction below.
    Artyom Degtyarev [JB]
    russhwolf
    2 replies
    Copy to Clipboard
  • Sebastian Sellmair [JB]

    Sebastian Sellmair [JB]

    1 year ago
    Just asking out of curiosity: Is there any library author, that would actually like to have types coming from a custom c-interop in their public APIs? I am not sure if this should actually be supported and if it would be a good thing for the MPP ecosystem. Any feedback is greatly appreciated!
    Sebastian Sellmair [JB]
    Kris Wong
    2 replies
    Copy to Clipboard
  • e

    Evan

    1 year ago
    I have a KMP library that I’m trying to write common tests for. My common code uses an expect/actual object to provide a platform specific dependency. Is there a way to provide a stub implementation for the commonTest module? Specifically, Android/iOS provide their own main and background Dispatchers. When running the commonTests I get the error:
    Exception in thread "Test worker @coroutine#1" java.lang.IllegalStateException: Module with the Main dispatcher had failed to initialize. For tests Dispatchers.setMain from kotlinx-coroutines-test module can be used
    However, kotlinx-coroutines-test is only for the JVM, so I’m not sure what to do here.
    e
    Benoît
    +1
    3 replies
    Copy to Clipboard
  • rsktash

    rsktash

    1 year ago
    Hi. Can we use
    ASAuthorizationController
    in iosMain module? I want to use sign in with Google in android and sign in with Apple in ios but the signing in logic must be separated from ui
    rsktash
    1 replies
    Copy to Clipboard
  • s

    Shawn Tucker

    1 year ago
    Hello, I am experiencing runtime crash when I try to access any of my Kotlin Library classes from iOS The error I get is not related to my actual code… (I try to initialize some other class that is not related to the class from the crash) It seems like swift is trying to materialize my classes during runtime and fails? What should I do?
    s
    Benoît
    6 replies
    Copy to Clipboard
  • i

    ivan.savytskyi

    1 year ago
    Hey folks, I'm trying to log exception on iOS via
    throwable.stackTraceToString()
    . But calling this API crashes with
    ncorrectDereferenceException: Trying to access top level value not marked as @ThreadLocal or @SharedImmutable from non-main thread
    exception and from stack trace of crash on iOS looks like it happens inside Throwable:
    #16	0x000000010fb50ffa in kfun:kotlin.Throwable.<init>$lambda-0#internal at /Users/teamcity/buildAgent/work/f01984a9f5203417/runtime/src/main/kotlin/kotlin/Throwable.kt:33
    #17	0x000000010fb511ef in kfun:kotlin.Throwable.$<init>$lambda-0$FUNCTION_REFERENCE$119.invoke#internal at /Users/teamcity/buildAgent/work/f01984a9f5203417/runtime/src/main/kotlin/kotlin/Throwable.kt:32
    #18	0x000000010fb7e907 in kfun:kotlin.native.concurrent.FreezeAwareLazyImpl.getOrInit#internal at /Users/teamcity/buildAgent/work/f01984a9f5203417/runtime/src/main/kotlin/kotlin/native/concurrent/Lazy.kt:28
    #19	0x000000010fb7f0b0 in kfun:kotlin.native.concurrent.FreezeAwareLazyImpl#<get-value>(){}1:0 at /Users/teamcity/buildAgent/work/f01984a9f5203417/runtime/src/main/kotlin/kotlin/native/concurrent/Lazy.kt:55
    #20	0x000000010fb4e975 in getValue [inlined] at /Users/teamcity/buildAgent/work/f01984a9f5203417/backend.native/build/stdlib/kotlin/util/Lazy.kt:44
    #21	0x000000010fb4e93f in kfun:kotlin.Throwable.<get-stackTraceStrings>#internal at
    Did anyone run into this as well? Also just ran quick test by doing this
    val tmp = RuntimeException().getStackTrace()
    it crashes as well
    i
    Benoît
    7 replies
    Copy to Clipboard