I am attempting to create an app using android studio and when trying to run the app I seem to have an issue with one of the fields for my database.
public void setTime(){
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
this.time = Time.from(Instant.now());
}
}
I keep getting error: Cannot find setter for field. private Date time; If i remove the if statement about build version I get the same issue but android studio also underlines the this.time = Time.from(Instant.now()); statement and advises me to surround it with the if statement. How do I fix this?