An Annotation argument must be a compile time constant
i have seen this question. Similar error.But in my case it is different. While working with Room i was creating table. it was working fine. @Daointerface UserDao { @Query("SELECT * FROM user") fun getAll(): List<User> @Insert(onConflict = OnConflictStrategy.REPLACE) fun insert(user: User) @Delete fun delete(user: User)} but then i found all table Names must be stored in a different class. like table name "user" - > Stored in different class. Eg. class Table { companion object { const val USER_TABLE = "user" }} But below code is not working . it is not picking up table name from Table class.