Kotlin Multiplattform Room Database Problem auf iOS - InstantiateImpl kann nicht behoben werden ()

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Kotlin Multiplattform Room Database Problem auf iOS - InstantiateImpl kann nicht behoben werden ()

by Anonymous » 21 Mar 2025, 08:47

Ich arbeite an einem KMP -Projekt (Kotlin Multiplatform) und versuche, eine Raumdatenbank zu implementieren, die sowohl für Android als auch für iOS funktioniert. Die Android -Seite funktioniert einwandfrei, aber ich begegne einen Build -Fehler auf der iOS -Seite mit dem folgenden Fehler:

Es ist nicht möglich, InstantiateImpl () zu beheben. AppDatabase {< /p>

Code: Select all

val dbFilePath = NSHomeDirectory() + "/my_room.db"
return Room.databaseBuilder(
name = dbFilePath,
factory = { AppDatabase::class.instantiateImpl() }  // Error occurs here
)
.setDriver(BundledSQLiteDriver()) // Required for iOS
.build()
}

Top