Open mrahimygk opened 5 years ago
Works great, if set up correctly, which is not easy, as Room is quite complicated starting out.
Maybe follow this tutorial https://www.youtube.com/watch?v=ARpn-1FPNE4 and read the instructions on how to implement RoomAsset!
And you know, that you must pass an actual class, right? Like this
RoomAsset.databaseBuilder(context!!.applicationContext, MyDatabase.class, "appname.v4.db") .fallbackToDestructiveMigration() .build()
And the Class musst be a Room Database (obviously).
Also you probably don't want to use .fallbackToDestructiveMigration() as it drops all rows, which renders importing a pre-populated database useless, this should be closed.
HEllo there, same issue found Failed to resolve: com.github.humazed:RoomAsset:1.0.3 with Room v 1.1.1, how can i resolve ??
Hi, Room now supports using a pre-packaged database out of the box, since version 2.2.0 Check this answer https://stackoverflow.com/a/57922686/4146943
With this error:
constructor RoomOpenHelper in class RoomOpenHelper cannot be applied to given types; required: DatabaseConfiguration,Delegate,String found: DatabaseConfiguration,,String,String
reason: actual and formal argument lists differ in length
and by this initialization:
RoomAsset.databaseBuilder(context!!.applicationContext, MyDatabase::class.java, "appname.v4.db") .fallbackToDestructiveMigration() .build()
I think there might be a difference between the constructor in Room and the one this lib is using.
Thanks for the great work.