I'm using the AssetSQLiteOpenHelper library on an Android application but when creating a new instance of the AssetSQLiteOpenHelperFactory
class in the following context:
RoomDatabase.Builder<AppDatabase> builder = Room.databaseBuilder(
context.getApplicationContext(),
AppDatabase.class,context.getString(R.string.database_name));
return (builder.openHelperFactory(new AssetSQLiteOpenHelperFactory())
.allowMainThreadQueries()
.addMigrations(MIGRATION_1_2).build());
I receive the error:
'openHelperFactory(androidx.sqlite.db.SupportSQLiteOpenHelper.Factory)' in
'androidx.room.RoomDatabase.Builder' cannot be applied to
'(com.fstyle.library.helper.AssetSQLiteOpenHelperFactory)'
This is contrary to what the documentation states(click here to view their documentation).
I have made sure to include their dependency in the build.gradle
file via:
implementation 'com.github.daolq3012:AssetSQLiteOpenHelper:V1.0.1'
I have tried 'Clean Project' -> 'Rebuild Project' and the 'Invalidate caches/Restart` options with no success.
Keep in mind I am answering this question myself as I have found a solution and want to share it with anyone else who might run into the same issue.