title: Unable to Retrieve Objects from Firestore
body: <p>I am new to Firebase and Kotlin, and am trying to make an application with it. I have a data class named Announcements, and I had saved the data for Announcements in Firestore. However, when I wanted to retrieve my data from Firestore, it keeps giving me the following error:</p>
  
  <pre><code>2019-10-09 03:14:13.016 14552-14552/com.example.finalyearproject W/Firestore: (21.1.1) [CustomClassMapper]: No setter/field for Content found on class com.example.finalyearproject.Announcement
  2019-10-09 03:14:13.017 14552-14552/com.example.finalyearproject W/Firestore: (21.1.1) [CustomClassMapper]: No setter/field for Title found on class com.example.finalyearproject.Announcement
  2019-10-09 03:14:13.017 14552-14552/com.example.finalyearproject W/Firestore: (21.1.1) [CustomClassMapper]: No setter/field for Id found on class com.example.finalyearproject.Announcement
  2019-10-09 03:14:13.018 14552-14552/com.example.finalyearproject W/Firestore: (21.1.1) [CustomClassMapper]: No setter/field for Date found on class com.example.finalyearproject.Announcement
  </code></pre>
  
  <p>Following is my codes:</p>
  
  <pre><code>val db = FirebaseFirestore.getInstance()
  val announcement = Announcement(_aTitle = "Hello Everyone", _aContent = "A new age begins.", _aDate = Date())
  announcement.writeToDatabase()
  
  val mAnnouncements: ArrayList&lt;Announcement&gt; = ArrayList()
  
  db.collection(Announcement.ANNOUNCEMENT_COLLECTION).get().addOnSuccessListener {
              mAnnouncements.addAll(it.toObjects(Announcement::class.java))
  }
  </code></pre>
  
  <p>Announcement Class:</p>
  
  <pre><code>class Announcement(_aId: UUID = UUID.randomUUID(), _aTitle: String = " ", _aContent: String = " ", _aDate: Date = Date()) {
  
      var aId = _aId
      var aTitle = _aTitle
      var aContent = _aContent
      var aDate = _aDate
  
      fun writeToDatabase() {
  
          val db = FirebaseFirestore.getInstance()
  
          val write = hashMapOf(
              ANNOUNCEMENT_ID to this.aId,
              ANNOUNCEMENT_TITLE to this.aTitle,
              ANNOUNCEMENT_CONTENT to this.aContent,
              ANNOUNCEMENT_DATE to this.aDate
          )
  
          db.collection(ANNOUNCEMENT_COLLECTION).document(this.aId.toString()).set(write).addOnSuccessListener { Log.d("Success", "Success") }
  
  
      }
  
      companion object {
          const val ANNOUNCEMENT_COLLECTION = "announcement"
          const val ANNOUNCEMENT_ID = "Id"
          const val ANNOUNCEMENT_TITLE = "Title"
          const val ANNOUNCEMENT_CONTENT = "Content"
          const val ANNOUNCEMENT_DATE = "Date"
      }
  }
  </code></pre>
  
  <p>I had tried to search for answers, but seems like there is no suitable answer in Kotlin. I had tried to add custom getter and setter for each variable, but still it does not works.</p>
  
  <p>Please help if anyone is able to solve my questions. Thank you in advance!</p>