https://kotlinlang.org logo
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
multiplatform
  • r

    Rahul

    12/07/2022, 9:02 AM
    Hello Team, I am creating kotlin library and using it into iOS App from https://kotlinlang.org/docs/apple-framework.html but I need to create different library for simulator and iphone . Can anyobody help to create single library for all iOS devices (edited)
    a
    • 2
    • 2
  • g

    Giorgi

    12/07/2022, 8:04 PM
    Hi guys, thanks for creating KMM. Im trying to create a repository with a KMM library that will be compatible to SPM. I have added Package.swift file with the binary link and checksum. But it fails with xcode complaining about wrong hash. It does not write the message fully but I assume it means that checksum was wrong. The project is here https://github.com/shalva97/google-auth-decode and checksum is specified here. the way I generated the hash code is in the pic So how should I generate correct checksum?
    j
    • 2
    • 6
  • d

    dorche

    12/07/2022, 9:28 PM
    Hi everyone, we already have two separate repos - 1 Android and 1 iOS for our apps at my company and I am looking for the "best" (most frictionless for our iOS devs) way to start sharing code between the 2 repos with KMM. Our app is quite new so we are using SPM only (no cocoapods) on the iOS side. Adding cocoapods won't be the end of the world but ideally we'd avoid it.. Could someone point me in a direction or any kind of reading materials describing our options?
    m
    c
    • 3
    • 8
  • k

    Kevin S

    12/08/2022, 12:19 AM
    Doe anyone know if there’s an SFTP library I can share between android and iOS? If not is there a way to use cinterop to bring in a c++ library?
    k
    • 2
    • 3
  • n

    Ninoosvanidze

    12/08/2022, 7:19 AM
    Hey ppl, I'm just implementing example from official site, it runs fine in :android: but have issue in iOS, returns, I see the same issue in github, shows already fixed but still here, using :face_holding_back_tears:
    val ktorVersion = "2.1.2"
    Exception doesn't match @Throws-specified class list and thus isn't propagated from Kotlin to Objective-C/Swift as NSError.
    It is considered unexpected and unhandled instead. Program will be terminated.
    Uncaught Kotlin exception: kotlin.native.concurrent.InvalidMutabilityException: mutation attempt of frozen io.ktor.client.request.HttpRequestPipeline@1cfa708
    h
    • 2
    • 7
  • p

    Pablo

    12/08/2022, 10:03 AM
    Which scope should be used to launch coroutines in kotlin multiplatform project? It's a class that generates some data for being displayed in compose desktop composable. I tryed with this:
    fun longJobFunction(): MutableList<BigData>{
        var bigDataList = mutableStateListOf<BigData>()
        CoroutineScope(Dispatchers.Main).launch {
            withContext(<http://Dispatchers.IO|Dispatchers.IO>) {
                //fill bigDataList with big data
                Thread.sleep(5000)
            }
        }    
        return bigDataList
    }
    But it gives this exception
    java.lang.IllegalStateException: Module with the Main dispatcher is missing. Add dependency providing the Main dispatcher, e.g. 'kotlinx-coroutines-android' and ensure it has the same version as 'kotlinx-coroutines-core'
    j
    k
    • 3
    • 5
  • r

    Rahul

    12/08/2022, 12:42 PM
    #multiplatform Hello Guys, I am creating multiplatform library for iphone . in build.gradle i have
    kotlin {
        android()
      
      
        iosArm64("native") {
            binaries {
                framework {
                    baseName = "Demo"
                }
            }
        }
    
     sourceSets {
            val commonMain by getting {
              
                    implementation("de.voize:pytorch-lite-multiplatform:0.5.0")
                
                }
            }
    }
     while generating framework I am getting following error
    Undefined symbols for architecture arm64:
      "_OBJC_CLASS_$_TorchModule", referenced from:
          objc-class-ref in result.o
      "_OBJC_CLASS_$_Tensor", referenced from:
          objc-class-ref in result.o
      "_OBJC_CLASS_$_IValueWrapper", referenced from:
          objc-class-ref in result.o
    ld: symbol(s) not found for architecture arm64
    Given library is multiplatform library
    Can anybody help?
    k
    • 2
    • 8
  • h

    Hee Fan

    12/09/2022, 7:17 AM
    hi guys, may I have you suggestion on Kotlin multiplatform reliable encryption library? Thanks. I have checked ionspin/kotlin-multiplatform-crypto , and ionspin/kotlin-multiplatform-libsodium. The libs are in experimental. It cannot pass our company’s cyber security review process.
    j
    • 2
    • 5
  • j

    John O'Reilly

    12/09/2022, 12:02 PM
    Anyone aware of why it's possible to run a
    main
    function in code in
    jvmMain
    in KMP shared code from within Android Studio....but not from IntelliJ?
    v
    • 2
    • 2
  • n

    Ninoosvanidze

    12/09/2022, 4:03 PM
    hey ppl, is there any way to use moshi json api in kmm shared code?
    c
    l
    • 3
    • 5
  • e

    eygraber

    12/09/2022, 6:39 PM
    Was there ever an explanation of
    kotlin.mpp.androidSourceSetLayoutVersion=2
    that doesn't require reading the source 😅
    k
    • 2
    • 1
  • s

    Seth Madison

    12/10/2022, 12:42 AM
    Anybody planning on attending CES from the world of KMM that would care to meet up and swap stories?
  • o

    oday

    12/10/2022, 5:37 PM
    has anyone faced this exception before when attempting to run on iOS? https://medium.com/@liwp.stephen/fix-kotlin-native-incorrectdereferenceexception-issue-on-kmm-project-71745c11d9a3 It isn’t clear where this solution should be placed, but the genius who posted this has also encountered the error
    j
    e
    • 3
    • 12
  • l

    Loe

    12/11/2022, 2:30 AM
    Hi guys, i’m converting my existing Android app into KMM and i’m having really hard time configuring gradle. The specific issue i’m hitting now is with adding Firebase Libraries:
    val commonMain by getting {
        dependencies {
            // Firebase: Import the BoM for the Firebase platform
            implementation(project.dependencies.platform("com.google.firebase:firebase-bom:31.0.2"))
            // Firebase: Cloud Firestore library BoM doesn't specify versions in Firebase library dependencies
            implementation("com.google.firebase:firebase-firestore-ktx")
            // Firebase: crashlytics
            implementation("com.google.firebase:firebase-crashlytics")
    
            // Firebase: Authentication
            implementation("com.google.firebase:firebase-auth-ktx")
            // Coroutines support libraries for Kotlin - required by firebase-analytics
            implementation("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.6.4")
    
            // TODO this is platform specific?
            //implementation("com.google.firebase:firebase-analytics-ktx")
        }
    }
    Error:
    :shared:iosArm64Main: Could not resolve org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.6.4.
    Required by:
        project :shared > com.google.firebase:firebase-firestore-ktx:24.4.0 > com.google.firebase:firebase-common-ktx:20.2.0
    
    Possible solution:
     - Declare repository providing the artifact, see the documentation at <https://docs.gradle.org/current/userguide/declaring_repositories.html>
    j
    j
    • 3
    • 5
  • r

    Racci

    12/11/2022, 3:50 AM
    is there a way to apply a gradle plugin to an individual target?
    a
    • 2
    • 7
  • c

    Christian Würthenr

    12/11/2022, 6:51 AM
    I have an odd crash in release mode only. Following code crashes with bad access 0x0 when accessing the
    by lazy
    part:
    val preferences by lazy { SharedBaseInjector.get().preferences } // Crash in this line
    
    fun something() {
        SharedBaseInjector.get().preferences  // This is fine
        val x = preferences.someValue
        ....
    }
    In debug mode everything is fine. If I wrap the preferences variable in an object it’s also fine in release mode:
    private object Cache {
    val preferences by lazy { SharedBaseInjector.get().preferences }
    }
    
    fun something() {
        val x = Cache.preferences.someValue
        ....
    }
    Anyone having a clue what’s going on? The object fixes it for me…but I’d still like to understand what’s going on
    h
    • 2
    • 4
  • s

    Slackbot

    12/12/2022, 11:38 AM
    This message was deleted.
  • m

    Mark Frelih

    12/12/2022, 3:33 PM
    Hello everyone! I am struggling with the next error for quite some time now:
    'pod install' command failed with an exception:
     Cannot run program "pod" (in directory "/Users/markfrelih/AndroidStudioProjects/app-sdk/iosApp"): error=2, No such file or directory
            
            Full command: pod install
            
            Possible reason: CocoaPods is not installed
            Please check that CocoaPods v1.10 or above is installed.
            
            To check CocoaPods version type 'pod --version' in the terminal
            
            To install CocoaPods execute 'sudo gem install cocoapods'
    I have searched this channel for similar issues, tried googling it but nothing helps. 🤷 I’ve tried: • Different versions of ruby • Installing cocoapods via brew instead of gem • https://stackoverflow.com/questions/70869813/android-studio-bumblebee-pod-install-command-failed-with-an-exception-error-2/70968187#70968187 The thing is that navigating to
    iosApp
    folder and running
    pod install
    manually works as expected. This is the output:
    Analyzing dependencies
    Downloading dependencies
    Generating Pods project
    Integrating client project
    Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.
    What is also interesting that I was able to solve it sometimes by running
    ./gradlew podInstall
    manually and then I was able to sync the project. The things is that I can’t figure out why this sometimes works and sometimes doesn’t (at this moment I can’t get it to work at all). 😅 kdoctor only complains about cocoapods-generate, which is not compatible with ruby 3.0.0+ and afaik is not even needed now. I had it working without cocoapods-generate before. I tried for example using ruby 2.7.6 + cocoapods-generate installed, so kdoctor was all green, but I still could not sync the project. My environment: • cocoapods - 1.11.3 • Ruby - 3.0.3 • Android Studio - Dolphin | 2021.3.1 Patch 1 • Xcode - 13.3 • M1 mac • macOS Monterey - 12.2 Any help is greatly appreciated! 🙏
    a
    • 2
    • 9
  • в

    Виталий Перятин

    12/12/2022, 3:41 PM
    Hello! When I execute
    ./gradlew publishToMavenLocal
    I get this error. What do I need to do to fix it?
    stacktrace.txt
    • 1
    • 1
  • e

    eygraber

    12/12/2022, 4:24 PM
    What's the latest version of xcode that works with Kotlin Native?
    m
    h
    • 3
    • 11
  • g

    Giorgi

    12/12/2022, 6:44 PM
    Hi, is there a KMM library like sshj? Want to connect to an ssh server but in a pure Kotlin way...
  • k

    Kirill Zhukov

    12/12/2022, 8:16 PM
    What could be the cause of IDE warnings like this? The code compiles just fine:
    • 1
    • 2
  • v

    Vinod Rai

    12/13/2022, 7:23 AM
    Hi, migrating to 2.2.1 ktor, getting this error.
    Module "io.ktor:ktor-io (io.ktor:ktor-io-iosarm64)" has a reference to symbol kotlin.ranges/contains|-4666807430820256279[0]. Neither the module itself nor its dependencies contain such declaration.
    build.gradle.kts
    plugins {
        kotlin("multiplatform")
        id("com.android.library")
    }
    
    kotlin {
        android()
        val frameworkName = "EmtCore"
        val ktorVersion = "2.2.1"
        listOf(
            iosX64(),
            iosArm64(),
            iosSimulatorArm64()
        ).forEach {
            it.binaries.framework {
                baseName = "shared"
            }
        }
    
        sourceSets {
            val commonMain by getting {
                dependencies {
                    implementation("org.jetbrains.kotlin:kotlin-stdlib-common")
                    implementation("io.ktor:ktor-client-core:$ktorVersion")
                    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
                    implementation("io.ktor:ktor-client-json:2.2.1")
                    implementation("com.russhwolf:multiplatform-settings:1.0.0-RC")
                    implementation("io.ktor:ktor-serialization-kotlinx-json:$ktorVersion")
                    implementation("io.ktor:ktor-network-tls:2.2.1")
                    implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.4.1")
                    implementation("com.soywiz.korlibs.klock:klock:3.4.0")
                    implementation("io.ktor:ktor-client-logging:2.2.1")
                    implementation("com.squareup.sqldelight:runtime:1.5.4")
                }
            }
            val commonTest by getting {
                dependencies {
                    implementation(kotlin("test"))
                }
            }
            val androidMain by getting {
                dependencies {
                    implementation("org.jetbrains.kotlin:kotlin-stdlib")
                    implementation("io.ktor:ktor-client-okhttp:$ktorVersion")
                    //implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9")
                    implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.4.1")
                    api("io.ktor:ktor-client-logging-jvm:2.2.1")
                    implementation("io.ktor:ktor-client-json-jvm:2.2.1")
                    implementation("io.ktor:ktor-client-serialization-jvm:2.2.1")
                    implementation("com.squareup.okhttp3:logging-interceptor:4.9.0")
                    implementation("com.squareup.sqldelight:android-driver:1.4.3")
                }
            }
            val androidTest by getting
            val iosX64Main by getting
            val iosArm64Main by getting
            val iosSimulatorArm64Main by getting
            val iosMain by creating {
                dependsOn(commonMain)
                iosX64Main.dependsOn(this)
                iosArm64Main.dependsOn(this)
                iosSimulatorArm64Main.dependsOn(this)
                dependencies {
                    implementation("io.ktor:ktor-client-darwin:$ktorVersion")
                    //implementation ("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9")
                    implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.4.1")
                    //implementation("io.ktor:ktor-client-serialization-iosarm64:1.4.0")
                }
            }
            val iosX64Test by getting
            val iosArm64Test by getting
            val iosSimulatorArm64Test by getting
            val iosTest by creating {
                dependsOn(commonTest)
                iosX64Test.dependsOn(this)
                iosArm64Test.dependsOn(this)
                iosSimulatorArm64Test.dependsOn(this)
            }
        }
    
        val debugFatFramework by tasks.creating(org.jetbrains.kotlin.gradle.tasks.FatFrameworkTask::class) {
            baseName = frameworkName
            from(
                iosX64().binaries.getFramework("debug")
            )
            destinationDir = buildDir.resolve("fat-framework/debug")
            group = "Universal framework"
            description = "Builds a debug universal (fat) framework"
        }
    
        val releaseFatFramework by tasks.creating(org.jetbrains.kotlin.gradle.tasks.FatFrameworkTask::class) {
            baseName = frameworkName
            from(
                iosArm64().binaries.getFramework("release")
            )
            destinationDir = buildDir.resolve("fat-framework/release")
            group = "Universal framework"
            description = "Builds a release universal (fat) framework"
        }
    }
    
    android {
        namespace = "com.emtcore"
        compileSdk = 33
        defaultConfig {
            minSdk = 21
            targetSdk = 33
        }
    }
    s
    • 2
    • 1
  • d

    diego-gomez-olvera

    05/05/2022, 3:51 PM
    I am thinking about what to use to perform network requests in KMM, given that the existing clients already have certain configurations and interceptions, and I was wondering if it makes sense having Ktor Client as layer on top of
    OkHttp
    and
    NSUrlSession
    with code like:
    // Android
    public fun newHttpClient(nativeClient: OkHttpClient): HttpClient {
        return HttpClient(OkHttp){
            engine {
                preconfigured = nativeClient
            }
        }
    }
    // iOS
    public fun newHttpClient(nativeSession: NSURLSession): HttpClient {
        return HttpClient(Darwin) {
            engine {
                configureSession { // how to do the same as Android?
                }
            }
        }
    }
    I was wondering if someone uses this approach, and how does he/she configures the iOS
    HttpClient
    k
    • 2
    • 2
  • e

    Elio Maroun

    12/13/2022, 11:55 AM
    import kotlinx.datetime.toJavaLocalDate
    import kotlinx.datetime.toJavaLocalTime
    I am getting unresolved error when I remove these libraries from gradle although they are not related, I tried to invalidate cache and restart but still the same issue.
    implementation("com.github.thellmund.Android-Week-View:core:5.2.4")
    implementation("com.github.thellmund.Android-Week-View:jsr310:5.2.4")
    implementation("com.github.thellmund.Android-Week-View:emoji:5.2.4")
    implementation("com.himanshoe:kalendar-endlos:1.0.0")
    a
    v
    • 3
    • 11
  • l

    Loe

    12/13/2022, 4:53 PM
    Hello, I’m having linking issue to Firebase Library. Yesterday, I had this error:
    ld: framework not found FirebaseAuth
    The solution [Described here] was to set
    isStatic = true
    :
    kotlin {
        android()
        
        listOf(
            iosX64(),
            iosArm64(),
            iosSimulatorArm64()
        ).forEach {
            it.binaries.framework {
                baseName = "shared"
                isStatic = true             <--------- This fixed it
        }
        . . .
    }
    Everything was working fine. Then it randomly started throwing a new linking error. I was also getting blank screen on iOS, but I resolved it by Erasing the simulator settings Then now i’m getting the following linking issue:
    Could not find or use auto-linked framework 'FirebaseAuth'
    Could not find or use auto-linked framework 'GoogleUtilities'
    Could not find or use auto-linked framework 'FirebaseCore'
    Could not find or use auto-linked framework 'GTMSessionFetcher'
    Could not find or use auto-linked framework 'FirebaseInstallations'
    Could not find or use auto-linked framework 'GoogleAppMeasurement'
    Could not find or use auto-linked framework 'GoogleAppMeasurementIdentitySupport'
    Could not find or use auto-linked framework 'FirebaseCoreDiagnostics'
    Could not find or use auto-linked framework 'GoogleDataTransport'
    Could not find or use auto-linked framework 'nanopb'
    Could not find or use auto-linked framework 'FirebaseAnalytics'
    Could not find or use auto-linked framework 'PromisesObjC'
    Undefined symbol: _FIRAuthErrorDomain
    Undefined symbol: _OBJC_CLASS_$_FIRUser
    Undefined symbol: _OBJC_CLASS_$_FIRMultiFactorSession
    Undefined symbol: _OBJC_CLASS_$_FIRPhoneAuthProvider
    Undefined symbol: _OBJC_CLASS_$_FIRAuthDataResult
    Undefined symbol: _OBJC_CLASS_$_FIRGoogleAuthProvider
    Undefined symbol: _OBJC_CLASS_$_FIRMultiFactorInfo
    Undefined symbol: _OBJC_CLASS_$_FIREmailAuthProvider
    Undefined symbol: _OBJC_CLASS_$_FIRGitHubAuthProvider
    Undefined symbol: _OBJC_CLASS_$_FIRFacebookAuthProvider
    Undefined symbol: _OBJC_CLASS_$_FIRActionCodeSettings
    Undefined symbol: _OBJC_CLASS_$_FIRTwitterAuthProvider
    Undefined symbol: _OBJC_CLASS_$_FIRAuth
    Undefined symbol: _OBJC_CLASS_$_FIROAuthProvider
    Undefined symbol: _OBJC_CLASS_$_FIROptions
    Undefined symbol: _OBJC_CLASS_$_FIRActionCodeInfo
    Undefined symbol: _OBJC_CLASS_$_FIRAuthTokenResult
    Undefined symbol: _OBJC_CLASS_$_FIRApp
    My Android app runs fine, but iOS is not working. btw I am following Make your Android application work on iOS – tutorial
    r
    • 2
    • 5
  • d

    Daniel

    12/13/2022, 9:55 PM
    Exception when calling Logout method for iOS. Method on the shared repo:
    suspend fun doLogout(token: String) {
        val userId = appService.currentUser!!.id
            realm.write {
                var user = query<UserInfo>("_id = $0", userId).first().find()
                if (user != null) {
                    user = findLatest(user)!!.also {
                        it.FCMToken.remove(token)
                    }
                    copyToRealm(user)
                }
        }
        withContext(Dispatchers.Default) {
            appService.currentUser?.logOut()
        }
    }
    the way that I call on the swiftUI:
    func doLogout(){
        repo.doLogout(token: myFCMToken){error in
          
        }
      }
    e
    • 2
    • 1
  • d

    Daniel

    12/13/2022, 9:56 PM
    This only crashes on the iOS version, I think its because realm tries to do the logout before doing the delete on realm db. Any idea what I am doing wrong here?
  • l

    Lukáš Kúšik

    12/14/2022, 10:18 AM
    Do the IDE code references between Kotlin and Swift work for anyone who uses AppCode with KMM? For me, objects from the shared Kotlin library in Swift code are red underlined, even the new KMM project template is broken for me.
    v
    c
    m
    • 4
    • 23
  • s

    Sebastien Leclerc Lavallee

    12/14/2022, 2:43 PM
    I have a shared KMM module which target iOS and Android. Is it possible to slim down the number of folder in the
    src
    folder as there is code only in
    androidMain
    ,
    commonMain
    , and
    iOSMain
    . Thanks!
    c
    l
    +2
    • 5
    • 12
Powered by Linen
Title
s

Sebastien Leclerc Lavallee

12/14/2022, 2:43 PM
I have a shared KMM module which target iOS and Android. Is it possible to slim down the number of folder in the
src
folder as there is code only in
androidMain
,
commonMain
, and
iOSMain
. Thanks!
c

Chrimaeon

12/14/2022, 2:45 PM
Just delete the other folders
s

Sebastien Leclerc Lavallee

12/14/2022, 2:48 PM
I never created them so my first guest would be that they will be re-created 🤔
c

Chrimaeon

12/14/2022, 2:49 PM
No, maybe the project setup wizard created them.
s

Sebastien Leclerc Lavallee

12/14/2022, 2:55 PM
This project is like 3-4 years old so not sure it was created with the wizard but I’ll remove the unnecessary folders and see how it goes 😅 thanks!
l

Landry Norris

12/14/2022, 3:44 PM
Which view are you in? One of the project views shows these folders even though they don’t ‘exist’. I generally use the ‘Project files’ view.
j

John O'Reilly

12/14/2022, 3:47 PM
this might help https://twitter.com/Sellmair/status/1543938828062392322
s

Sebastien Leclerc Lavallee

12/14/2022, 3:47 PM
@Landry Norris I’m in the project view @John O'Reilly Thanks I’ll have a look
j

John O'Reilly

12/14/2022, 3:48 PM
using it in https://github.com/joreilly/PeopleInSpace fwiw
l

Landry Norris

12/14/2022, 3:48 PM
I think Project view often shows source sets that don’t exist, but are technically ‘registered’
I like Project Files, since it matches the folder structure, but also highlights folders like the Project view does, but it’s a matter of preference. Try out a few different views.
s

Sebastien Leclerc Lavallee

12/14/2022, 4:30 PM
I have deleted the folder and project still builds so that’s a good starting point 😅 I’ll see how it goes @John O'Reilly I had already set it to false, probably after seeing that tweet a few months ago 😏 @Landry Norris Thanks for the tip! I like the Project Files view a lot since it filters a lot of folder that I don’t want to see but still be able to get them in a special subfolder. Pretty cool
m

Mustafa Ozhan

01/17/2023, 9:23 AM
Is there any way to hide them in
Android
view ?
View count: 41