I am trying to add one month to a date with Calendar.getInstance() but I can't figure out why there is error "java.lang.ClassCastException : java.util.Date cannot be cast to java.lang.Number" when trying to get the Calendar to a Date object.
Here's the source code that I am using :
val date = Date()
val cal = Calendar.getInstance()
cal.time = date
cal.add(Calendar.MONTH, 1)
val datePlusOneMonth: Date = cal.time