Hey guys I’m getting problem with SQLDelight I can...
# multiplatform
e
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
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
the problem I’m not getting an error , it’s just unresolved dependencies in the iOSMain 😕
some dependencies are seen others no
a
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
@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
Not sure if it's a factor but I'm typically running using Arctic Fox beta these days
a
@Elyes Ben Salah I think you need to tag other person , i am not the correct one .
j
Had been using Canary but switched to Arctic Fox once Jetpack Compose was supported on that
e
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
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
here my config update :
Copy code
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
Ah, weird. That should resolve OK then, at least for target related issues
e
I got Undefined symbols for architecture x86_64: sqldelight so I added ”
Copy code
targets.getByName<KotlinNativeTarget>("ios").compilations.forEach {
        it.kotlinOptions.freeCompilerArgs += arrayOf("-linker-options", "-lsqlite3")
    }
and I’m working with Intellij IDEA 😕
k
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
yeah in XCode build
I’m really confused about the problem , I tried also github repositories got same error