• d

    dimsuz

    7 months ago
    We have a sealed class hierarchy:
    sealed 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?
    d
    russhwolf
    +1
    6 replies
    Copy to Clipboard
  • f

    Felipe Sáez

    7 months ago
    Hello everyone, I hope you are all doing great. I’m currently trying to get an existing iOS/tvOS framework to consume a new KMM framework. When a new Kotlin Multi Platform Project (KMM) is created from Android Studio, the wizard gives you the option to choose between CocoaPods or XCFramework integrations (see image). 1. When using CocoaPods a new task named
    podspec
    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. Cheers
    f
    Viacheslav Kormushkin
    7 replies
    Copy to Clipboard
  • g

    grahamborland

    7 months ago
    When I build an MPP project for JS browser(IR) target, the Webpack task copies the
    .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?
    g
    Big Chungus
    10 replies
    Copy to Clipboard
  • Matthew Kruk

    Matthew Kruk

    7 months ago
    Trying to figure out kmm library structure when publishing iOS library on cocoapods. I have setup a cocoapod to import the shared code into the ios module and all is good. The podspec is in the shared module. Do I need to add an additional podspec for distribution of the ios module? If so, would I use the root project as the source?
    Matthew Kruk
    1 replies
    Copy to Clipboard
  • Justin Xu

    Justin Xu

    7 months ago
    Hi everyone, I’m getting started with KMM with cocoapods as outlined in the documentation on the website, but I keep running into this error:
    '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.
    Justin Xu
    Eamon Keane
    2 replies
    Copy to Clipboard
  • g

    Gillian Buijs

    7 months ago
    is there a way to make all the dependencies in commonMain/androidMain transitive so that they'll be added to the generated .aar file?
    g
    Scott Kruse
    4 replies
    Copy to Clipboard
  • theapache64

    theapache64

    7 months ago
    How do i create a multiplatform compose UI library ? I want to create a Compose UI lib that would be used in android and desktop apps. Can anyone point me to the right doc?
    theapache64
    Chrimaeon
    6 replies
    Copy to Clipboard
  • Peter Hsu

    Peter Hsu

    7 months ago
    I can't seem to get Android Studio to play nice with KMM on Bumblebee or Bumblebee Patch 1, with Kotlin Multiplatform Mobile plugin installed
    Peter Hsu
    6 replies
    Copy to Clipboard
  • khairil.ushan

    khairil.ushan

    7 months ago
    I am trying to play along with KMM on Android Studio, after creating a brand new project with the KMM plugin wizard on my Android Studio, I can run the app to Android Emulator just fine. But when I tried to run it on iOS simulator, I got this error
    Task '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.
    khairil.ushan
    michaelv
    9 replies
    Copy to Clipboard
  • e

    eygraber

    7 months ago
    Is there supposed to be support for KMP in Android Studio? I'm on Chipmunk Beta 1, and for kotlin files in a KMP module I get no code completion, and everything is red (but it compiles).
    e
    Artyom Degtyarev [JB]
    2 replies
    Copy to Clipboard