So i am now trying to experiemnt with Room in mult...
# multiplatform
So i am now trying to experiemnt with Room in multiplatform, but having an issue. For the ios/native component when i try to call the the "instantiateImpl()" function on the AppDatabase kclass, it is coming up as unresolved. When i look in the build generated classes by ksp I can see the extension function. Why can't I call it in my code? For reference this is the code snippet I am speaking about:
Copy code
fun getDatabaseBuilder(): RoomDatabase.Builder<AppDatabase> {
    val dbFilePath = NSHomeDirectory() + "/my_room.db"
    return Room.databaseBuilder<AppDatabase>(
        name = dbFilePath,
        factory =  { AppDatabase::class.instantiateImpl() }
I ran in to same problem and then noticed this in
Having said that, it does still show up as unresolved in IDE (Android Studio stable at least) but does build with that setting
🙌 1
Oh thanks for that confirmation. I did see that fix, but also saw that it was still showing up as unresolved. Glad to know that it isn't just me experiencing that issue.
I'm unable to add it into gradle, how did you guys manage. I get
not found
. I created a new module, google maven is added to the project.
This is the project I'm using it in if you want to compare anything
@Martin Gaynor did it work for you after that?
I came to this thread through @John O'Reilly project. 🙂 Now I'm following this thread. 🙃
Are folks here still having issues building? If so, does build for you or. not (as opposed to "just" the error shown in the IDE)?
So, the import was main issue?
I copied over I think from official sample which is probably why I had it
Yes, even as mentioned in the issue tracker, I just used ksp( and commented out the add("ksp....) codes and still worked fine. It's just the import section was the issue. Thanks for your help too, just wanted to update here once that it's resolved.
I see. Thanks for your awesome repository though, it helped me a lot, and awesome work! 😁
👍 1
@John O'Reilly sorry i took so long to get back to you. Yea it was working after that, but was still showing as an error in the IDE. Since then I have gone back to using sqldelight, as I wait for room to mature for multiplatform.
I also faced this issue. Importing the
class worked.
🙌 1