Android Room : Each bind variable in the query must have a matching method

Kotlin isn’t preserving the names of the arguments properly – this is https://youtrack.jetbrains.com/issue/KT-17959

You can work around this by using :arg0, :arg1, etc, as parameter names in your @Query statements:

@Query("SELECT * FROM countries WHERE id = :arg0")
fun loadCountry(countryId: Int): LiveData<CountryEntity>

@Query("SELECT * FROM countries WHERE id = :arg0")
fun loadCountrySync(countryId: Int): CountryEntity

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)