• b

    Bart Whiteley

    10 months ago
    When I run
    ./gradlew assembleXCFramework
    , the resulting XCFramework is missing the
    ios-arm64-simulator
    slice. What am I doing wrong?
    b
    d
    2 replies
    Copy to Clipboard
  • p

    Paulo Cereda

    10 months ago
    Hi friends! We have a Kotlin JVM project which currently uses MVEL as expression language. One of our long term goals is to provide native executables. Therefore we are migrating to Kotlin multiplatform, but the MVEL dependency seems to be still a blocker for us. Does anybody know of any expression language in which we could use? Any feedback is welcome. Thanks! 😉
    p
    e
    +1
    8 replies
    Copy to Clipboard
  • Andrew O Hart

    Andrew O Hart

    10 months ago
    Also, we have several cinterop .def files etc, we can use them in iosMain,however all references to the classes are Red, like they are not resolved. Any ideas on how this can be fixed? If its even possible I'm not sure. It compiles fine just auto complete/import and viewing of methods etc doesnt work
    Andrew O Hart
    russhwolf
    2 replies
    Copy to Clipboard
  • Sebastian Sellmair [JB]

    Sebastian Sellmair [JB]

    10 months ago
    ⚠️ IMPORTANT PSA FOR MULTIPLATFORM/ANDROID LIBRARY AUTHORS ⚠️ TL;DR: Publishing multiplatform libraries with Android Gradle Plugin 7.1.0-alpha13 (or higher) will require Kotlin Gradle Plugin 1.6.10 (or higher).

    What happened

    We detected a recent incompatibility between newer pre-release Android Gradle Plugin versions and the current Kotlin Multiplatform Gradle Plugin. To be more precise: Starting from AGP version 7.1.0-alpha13, Android related Gradle configurations will set an internal attribute that will unfortunately be copied by Kotlin during the publication process of a library. This Gradle attribute will effectively tell Gradle, that the Library is only compatible with builds using the exact same AGP version. Obviously, this is not correct and not desirable. Libraries published with this attribute will therefore be almost “un-consumable” by users.____________

    Consequences for you (the Library author)

    When upgrading AGP to 7.1.0-alpha13 (or higher), make sure you are using Kotlin Gradle Plugin 1.6.10 (or higher) to create proper publications. When using AGP 7.1.0-alpha12 (or lower), this does not affect you.____________

    Consequences for you (Application Developer)

    None, enjoy!____________

    Appendix

    We know, that issues like this are uncomfortable for users. Integrating Android into multiplatform is hard and this is not the first time we suffered from Android+Multiplatform issues. We (the Kotlin, more precise the Kotlin Multiplatform Core, Team) are aware of this and are actively working together with Google (more precise the AGP team) to find better ways of working together/integrating. Some very ambiguous plans were made recently and we started working on it already. ____________ The workaround on the Kotlin Gradle Plugin side can be tracked here:https://youtrack.jetbrains.com/issue/KT-49798 This is currently in review and is planned to be shipped in 1.6.10 Thanks folks and I hope you’ll have a more enjoyable Friday than I do 😁 :kotlin:
    Sebastian Sellmair [JB]
    russhwolf
    +2
    5 replies
    Copy to Clipboard
  • Mihai Voicescu

    Mihai Voicescu

    10 months ago
    Having at least 1 normal Multiplatform build (js+jvm+native) + 1 Multiplatform with android seems to break the build by loading a plugin 2 times, although I used the apply false method. Any ideas how I can fix it or what am I doing wrong? settings.gradle.kts:
    pluginManagement {
        resolutionStrategy {
            eachPlugin {
                if (requested.id.namespace == "com.android") {
                    useModule("com.android.tools.build:gradle:4.1.2")
                }
            }
        }
        plugins {
            id("com.android.library") apply false
            kotlin("multiplatform") version kotlin_version apply false
            kotlin("plugin.serialization") version kotlin_version apply false
    subproject build.gradle.kts:
    plugins {
        kotlin("multiplatform")
        kotlin("plugin.serialization")
        id("com.android.library")
    }
    
    kotlin {
    js {browser {
    
            }}}
    Short trace:
    org.gradle.internal.exceptions.LocationAwareException: Build file '/Users/mihaivo/IdeaProjects/gaia/gaia-phone-client/build.gradle.kts' line: 26
    
    Caused by: org.gradle.api.reflect.ObjectInstantiationException: Could not create an instance of type org.jetbrains.kotlin.gradle.targets.js.subtargets.KotlinBrowserJs.
    	at org.gradle.internal.instantiation.generator.DependencyInjectingInstantiator.doCreate(DependencyInjectingInstantiator.java:69)
    	at org.gradle.internal.instantiation.generator.DependencyInjectingInstantiator.newInstance(DependencyInjectingInstantiator.java:55)
    	at org.gradle.api.internal.model.DefaultObjectFactory.newInstance(DefaultObjectFactory.java:85)
    
    Caused by: java.lang.IllegalStateException: The Kotlin Gradle plugin was loaded multiple times in different subprojects, which is not supported and may break the build. 
    This might happen in subprojects that apply the Kotlin plugins with the Gradle 'plugins { ... }' DSL if they specify explicit versions, even if the versions are equal.
    Please add the Kotlin plugin to the common parent project or the root project, then remove the versions in the subprojects.
    If the parent project does not need the plugin, add 'apply false' to the plugin line.
    See: <https://docs.gradle.org/current/userguide/plugins.html#sec:subprojects_plugins_dsl>
    	at org.jetbrains.kotlin.gradle.targets.js.MultiplePluginDeclarationDetector.detect(MultiplePluginDeclarationDetector.kt:26)
    	at org.jetbrains.kotlin.gradle.targets.js.MultiplePluginDeclarationDetector$Companion.detect(MultiplePluginDeclarationDetector.kt:52)
    	at org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin.apply(NodeJsRootPlugin.kt:23)
    Mihai Voicescu
    hfhbd
    4 replies
    Copy to Clipboard
  • Ruben Quadros

    Ruben Quadros

    10 months ago
    Hi guys, I updated the kmm plugin and then upgraded kotlin version to
    1.6.0
    and the project is not syncing anymore. I also get the same error when trying to create a new KMM project. I have tried
    pod install
    in
    iosApp
    and then sync but still the same error. I have also tried invalidate caches and restart (AS). Stack trace in the thread.
    Ruben Quadros
    s
    3 replies
    Copy to Clipboard
  • jean

    jean

    10 months ago
    async
    is not resolved from my common package but
    CompletableDeferred
    is. Does kmm prevent usage of
    async
    keyword somehow? Or is it because I’m using the native-mt version of kotlinx.coroutine?
    jean
    louiscad
    2 replies
    Copy to Clipboard
  • Nacho Ruiz Martin

    Nacho Ruiz Martin

    10 months ago
    👋 I have a shared KMM module that is fetched from a git submodule from my Android app. Each time gradle is synced, Android Studio is running the iOS tasks which actually take plenty of time and are not needed in this context. In other place, I use this KMM module to produce a XCFramework that is published using Cocoapods, there I really need the iOS tasks. Is there any way to disable the iOS building stuff in the Android app context?
    Nacho Ruiz Martin
    Paul Woitaschek
    2 replies
    Copy to Clipboard
  • u

    ursus

    10 months ago
    If I have android project with dagger @Inject constructors on classes I want now to share via multiplatform, I'm screwed right? (talking about the inject annotation, coming from jdk)
    u
    m
    +1
    4 replies
    Copy to Clipboard
  • Matti MK

    Matti MK

    10 months ago
    I’m still on Xcode
    12.5.1
    , wondering about updating to 13, I guess it should be safe already. Did anyone face issues on updating the version?
    Matti MK
    t
    3 replies
    Copy to Clipboard