• Siggi Gunnarss

    Siggi Gunnarss

    1 year ago
    Hi all. I have a highlighting bug in my project where any references in .kt files in my main module to classes in other modules are marked in red.
    (Cannot access class...)
    The project compiles and runs as expected and Java files are not affected. It started with the kotlin plugin version 1.4 and it's still an issue with 1.4.20-M1. Using an older plugin, 1.3.72 fixes the issue, but the project is on Kotlin 1.4 so that's not a good workaround. The project is a kotlin multiplatform project so I suspect that's the issue Before I raise an issue with Jetbrains I want to understand the problem better, has anyone encountered this?
    Siggi Gunnarss
    m
    3 replies
    Copy to Clipboard
  • jean

    jean

    1 year ago
    I’ve been trying to configure sqldelight in my project since yesterday, but without any success so far
    plugins {
        kotlin("multiplatform") version "1.4.10"
        id("com.squareup.sqldelight")
    }
    
    buildscript {
        repositories {
            jcenter()
        }
    
        dependencies {
            classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.0")
            classpath ("com.squareup.sqldelight:gradle-plugin:1.4.3")
        }
    }
    
    sqldelight {
        database("MyDatabase") {
            packageName = "com.my.package.name.sqldelight"
        }
    }
    I also created a
    News.sq
    file in
    src/commonMain/sqldelight/com/my/package/name/sqldelight
    Running
    gradlew build
    succeed but I can’t see that
    MyDatabase
    class is generated. Am I suppose to do anything more?
    jean
    m
    +1
    10 replies
    Copy to Clipboard
  • Mikołaj Kąkol

    Mikołaj Kąkol

    1 year ago
    I've added atomicfu to project like this in commonMain
    compile "org.jetbrains.kotlinx:atomicfu-common:0.14.4"
    now my build on ios fails, any suggestion
    Execution failed for task ':shared:compileKotlinIos'.
     > Could not resolve all files for configuration ':shared:iosCompileKlibraries'.
        > Could not resolve org.jetbrains.kotlinx:atomicfu-common:0.14.4.
          Required by:
              project :shared
           > No matching variant of org.jetbrains.kotlinx:atomicfu-common:0.14.4 was found. The consumer was configured to find a usage of 'kotlin-api' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native', attribute 'org.jetbrains.kotlin.native.target' with value 'ios_x64' but:
               - Variant 'metadata-api' capability org.jetbrains.kotlinx:atomicfu-common:0.14.4:
                   - Incompatible because this component declares a usage of 'kotlin-metadata' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'common' and the consumer needed a usage of 'kotlin-api' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native'
                   - Other compatible attribute:
                       - Doesn't say anything about org.jetbrains.kotlin.native.target (required 'ios_x64')
               - Variant 'metadata-commonMainMetadataElements' capability org.jetbrains.kotlinx:atomicfu-common:0.14.4 declares a usage of 'kotlin-api' of a component:
    ...
    Mikołaj Kąkol
    m
    5 replies
    Copy to Clipboard
  • altavir

    altavir

    1 year ago
    @dsavvinov Really nice talk. I had to listen to it with a slight delay due to lectures, but it was really helpful.
    altavir
    dsavvinov
    +6
    14 replies
    Copy to Clipboard
  • Соловьев Георгий

    Соловьев Георгий

    1 year ago
    Hello, I have a problem with linkDebugFrameworkIosX64 gradle task. linkDebugFrameworkIosArm64 and linkReleaseFrameworkIosX64 work without any problems. But on x64 debug I have that error. How can I fix it?
    Соловьев Георгий
    1 replies
    Copy to Clipboard
  • Aleksandr Ivanov

    Aleksandr Ivanov

    1 year ago
    Is there anyone experienced with apollo graphql multiplatform library? It is working fine on android but on iOS we got empty body on our backend.
    Aleksandr Ivanov
    louiscad
    +1
    24 replies
    Copy to Clipboard
  • myrronth

    myrronth

    1 year ago
    How do I declare a weak variable with the expect/actual pattern that also becomes a weak variable when used in Swift? I’ve tried
    actual var listener: WeakReference<T>? = null
    and updated my calls to
    listener?.get()?.method()
    . But once I use my shared code in Swift, the
    listener
    variable is not the expected
    weak var listener: T
    but a wrapped
    KotlinWeakReference
    . If I use this, it is the same as without – the value assigned to listener, a UIViewController, does not get deallocated once all the references in the concrete implementation are gone (the view controller gets dismissed and should not receive further messages from the listener)
    myrronth
    a
    5 replies
    Copy to Clipboard
  • Elka

    Elka

    1 year ago
    Hello, I am trying to build a multi-platform client that retries the request automatically when the token expired and 401 is returned from the server. For that I am using a sample code by moko-network. The refresh token api is being triggered but when it retries the  request using 
    request
     , I never get a 
    result
     as if some “deadlock” occurred.
    val requestBuilder = HttpRequestBuilder().takeFrom(context.request)
    val result: HttpResponse = context.client!!.request(requestBuilder)
    Any idea? Anyone implemented a RefreshToken feature that works with latest Ktor?
    Elka
    r
    6 replies
    Copy to Clipboard
  • rsetkus

    rsetkus

    1 year ago
    Hi. I am fairly new to Multiplatform. Sounds quite trivial question but is it possible to run unit tests from IDE for common module? Created an empty project and when clicking 'Run' button 'Nothing here' pops up.
    rsetkus
    s
    +2
    15 replies
    Copy to Clipboard
  • a

    Anvith

    1 year ago
    I recently upgraded to kotlin 1.4.1 and it seems that the adding any pod file via the native.cocoapods plugin is causing the the gradle task
    linkDebugFrameworkIosSim
    to throw an error
    Could not find <project-name> in …
    I’ve attached the relevant trace for completeness. How do I resolve this or am I missing something?
    a
    Artyom Degtyarev [JB]
    6 replies
    Copy to Clipboard