title: Why are my TypeConverters not recognized/working? Kotlin/ Android
body: <p>I am implementing TypeConverters for <code>date?</code> This seems wrong as <code>java.util.date</code> is deprecated. <code>Kotlinx.datetime.LocalDate</code> is supposed to be serializable but is also not working.</p>
  <p>Task: add expiration and start dates to an Entity in Room that will come from the date picker so I imagine will return a <code>Calendar</code> which I also tried to no avail.</p>
  <p>I am getting this error</p>
  <pre><code>Bottle.java:23: error: Cannot figure out how to save this field into database. You can consider adding a type converter for it.
      private final java.util.Date expirationDate = null;
  </code></pre>
  <p>On this generated portion</p>
  <pre class="lang-java prettyprint-override"><code>
     21  @org.jetbrains.annotations.Nullable
     22  @androidx.room.ColumnInfo
     23  private final java.util.Date expirationDate = null;
     24  @org.jetbrains.annotations.Nullable
     25  @androidx.room.ColumnInfo
     26  private java.util.Date startDate;
  </code></pre>
  <p>Bottle class:</p>
  <pre class="lang-kotlin prettyprint-override"><code>@Entity(tableName = &quot;bottles&quot;)
  @Serializable
  
  data class Bottle(
      @PrimaryKey (autoGenerate = true)
      @ColumnInfo val bottleID : Int?,
      @ColumnInfo val consumableID: String,
      @ColumnInfo  @Contextual val expirationDate : Date?,
      @ColumnInfo @Contextual var startDate : Date?,
      @ColumnInfo val cabinetID: String
  )
  </code></pre>
  <p>DataBase</p>
  <pre class="lang-kotlin prettyprint-override"><code>@Database(entities = [
      Cabinet::class,
      Bottle::class,
      Consumable::class,
  ], version = 1)
  
  @TypeConverters(Converters::class)
  
  abstract class PillMinderDatabase : RoomDatabase() {
      abstract val cabinetDAO: CabinetDAO
      abstract val bottleDAO: BottleDAO
      abstract val consumableDAO: ConsumableDAO
  
  }
  </code></pre>
  <p>Converters</p>
  <pre class="lang-kotlin prettyprint-override"><code>class Converters {
      companion object {
  
  //**************************** CALENDAR CONVERTERS ****************************//
   
          @TypeConverter
          @JvmStatic
          fun dateToLong(date: Date?): Long? = date?.time
  
          @TypeConverter
          @JvmStatic
          fun longToDate(dateInMillis: Long?): Date? = dateInMillis?.let { Date(dateInMillis)}
  
     }
  }
  
  
    [1]: https://i.stack.imgur.com/PsO5F.png
  </code></pre>