title: How to resolve "Entities and POJOs must have a usable public constructor"
body: <p>I have seen this question <a href="https://stackoverflow.com/q/61480808/317027">several</a> times on SO. however the solution doesn't seem to apply to my problem.</p>
  <p>I have a Kotlin data-class that is used as an Entity in Room</p>
  <pre><code>@Entity(tableName = &quot;training_session&quot;)
  data class SessionEntity(
      @PrimaryKey(autoGenerate = false) val id: Long,
      @ColumnInfo(name = &quot;current_state_marker&quot;) val currentState: Short,
      @Embedded val states: List&lt;Int&gt;
  )
  </code></pre>
  <p>It is producing</p>
  <pre><code>&gt; Task :training-infrastructure:kaptDebugKotlin FAILED
  error: Entities and POJOs must have a usable public constructor. You can have an empty constructor or a constructor whose parameters match the fields (by name and type). - java.util.List
  error: Entities and POJOs must have a usable public constructor. You can have an empty constructor or a constructor whose parameters match the fields (by name and type). - java.util.List
  </code></pre>
  <p>In the same project I have a very similar entity which also has a list and that doesn't produce any errors.</p>
  <hr />
  <p>Tried out the answer provided by <a href="https://stackoverflow.com/a/69958933/317027">MikeT</a>, for me it required a small <a href="https://stackoverflow.com/a/45071364/317027">change</a> in the way the converters were defined</p>
  <pre><code>data class SessionStateList (val stateList : List&lt;Int&gt;) 
  
  class SessionStateListConverter {
  
      @TypeConverter
      fun fromArraySessionStateList(sh: List&lt;Int&gt;?): String? {
          return Gson().toJson(sh)
      }
      @TypeConverter
      fun toArraySessionStateList(sh: String?): List&lt;Int&gt;? {
          val listType: Type = object : TypeToken&lt;ArrayList&lt;Int?&gt;?&gt;() {}.type
          return Gson().fromJson(sh,listType)
      }
  }
  </code></pre>
  <hr />
  <p>A quick follow-up.  I had mentioned that I have another Entity that has an <code>Embedded val something: List&lt;Int&gt;</code> and I had not noticed any compiler errors.</p>
  <p>The reason, I had not noticed any compiler errors was because the entity was not included in the <code>@Database</code> annotation.</p>