https://kotlinlang.org logo
Title
e

Elyes Ben Salah

07/10/2021, 6:38 PM
Hey guys I’m getting problem with SQLDelight I cant find the NativeSQLiteDriver I tried everything and I don’t get the problem, Here configuration
j

John O'Reilly

07/10/2021, 7:28 PM
What's exact error you're getting? Am using that same version in following fwiw in case you want to do any comparison https://github.com/joreilly/PeopleInSpace
e

Elyes Ben Salah

07/10/2021, 7:39 PM
the problem I’m not getting an error , it’s just unresolved dependencies in the iOSMain 😕
some dependencies are seen others no
a

Abhishek Dewan

07/11/2021, 12:10 AM
are you not able to build the application or just that ide shows the error ?
if later probably needs a invalidate cache and restart
e

Elyes Ben Salah

07/11/2021, 9:25 AM
@Adarsh Gumashta just the IDE shows the error , I tried to invalidate the cache and same error , @John O'Reilly I tried also the project same problem iOSMain can’t see the Native libraries , so I think it’s problem related to my local environment , here my env conf : MacOS Big Sur 11.4 Android Studio 2021.1.1 Canary.3 KMM plugin : 0.2.6(211-1.5.10-release-891-IJ)-71 Java SDKMan : 8.0.292.hs-adpt & 11.0.11.hs-adpt switching between both if needed ( current : 11.0.11.hs-adpt)
j

John O'Reilly

07/11/2021, 9:26 AM
Not sure if it's a factor but I'm typically running using Arctic Fox beta these days
a

Adarsh Gumashta

07/11/2021, 9:27 AM
@Elyes Ben Salah I think you need to tag other person , i am not the correct one .
j

John O'Reilly

07/11/2021, 9:27 AM
Had been using Canary but switched to Arctic Fox once Jetpack Compose was supported on that
e

Elyes Ben Salah

07/12/2021, 9:34 AM
I endup by using Intellij IDEA with the Shared Project ( I added gradle wrapper and configure it as an Independent project) , strange problem couldn’t find solution , and everytime I add code and build the shared ( I disable android to avoid the gradle error Android Studio plugin outdate) and work in XCode that’s the only option same code works with IDEA but not Android studio
k

kpgalligan

07/12/2021, 3:13 PM
Dependency resolution issues like that are generally (for me) due to the hierarchical plugin. How do you declare your targets? If it's
ios()
vs
iosX64()
(or similar), that may be what's happening here. "work in XCode" you mean you can run it from XCode? I haven't been building with the KMM plugin as much, so does it not run if it can't resolve everything in the IDE?
Gradle and the IDE don't always agree.
e

Elyes Ben Salah

07/12/2021, 3:18 PM
here my config update :
kotlin {
    //android()

    val isDevice = System.getenv("SDK_NAME")?.startsWith("iphoneos") == true
    if (isDevice)
        iosArm64("ios")
    else
        iosX64("ios")

    targets.getByName<KotlinNativeTarget>("ios").compilations.forEach {
        it.kotlinOptions.freeCompilerArgs += arrayOf("-linker-options", "-lsqlite3")
    }

    cocoapods {
        summary = "Some description for the Shared Module"
        homepage = "Link to the Shared Module homepage"
        ios.deploymentTarget = "14.1"
        frameworkName = "shared"
        podfile = project.file("../iosApp/Podfile")
    }
k

kpgalligan

07/12/2021, 3:19 PM
Ah, weird. That should resolve OK then, at least for target related issues
e

Elyes Ben Salah

07/12/2021, 3:20 PM
I got Undefined symbols for architecture x86_64: sqldelight so I added ”
targets.getByName<KotlinNativeTarget>("ios").compilations.forEach {
        it.kotlinOptions.freeCompilerArgs += arrayOf("-linker-options", "-lsqlite3")
    }
and I’m working with Intellij IDEA 😕
k

kpgalligan

07/12/2021, 3:21 PM
If the sqlite3 linking fixed that, that's expected. sqldelight adds that linker option, but it only carries over if you have dynamic frameworks.
"Undefined symbols for architecture x86_64" only happens when you try to build, though, right? Not in the idea (not sure where it would)
e

Elyes Ben Salah

07/12/2021, 3:22 PM
yeah in XCode build
I’m really confused about the problem , I tried also github repositories got same error