Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio stack=java.lang.NoClassDefFoundError: Failed resolution of: Landroid/icu/util/Calendar;

I have used the calendar class for a alarm app with the alarm manager, but I have an error with the instance of the class calendar. I have investigated in other forums but I haven't find the proper solutions. please I need your help.

the error is marked in the instance of the calendar class enter image description here

like image 697
Emmanuel Garcia Martinez Avatar asked Nov 11 '16 03:11

Emmanuel Garcia Martinez


2 Answers

As far as i can see, you could just use the normal Calendar instead of the in API 24 introduced ICU Calendar. Try to use this import java.util.Calendar instead of this import android.icu.util.Calendar.

like image 180
Tyrmos Avatar answered Oct 06 '22 08:10

Tyrmos


From Calendar pick date: import java.util.Calendar instead of this import android.icu.util.Calendar And Then write those code code for Date Pick.

Calendar callForDate = Calendar.getInstance();

java.text.SimpleDateFormat currentDate = new java.text.SimpleDateFormat("dd-MMMM-yyyy");

final String saveCurrentDate = currentDate.format(callForDate.getTime());
like image 23
Maizied Hasan Shuvo Avatar answered Oct 06 '22 08:10

Maizied Hasan Shuvo