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

拥有回忆 提交于 2019-12-07 02:54:15

问题


sorry my english is not very good but.

i use the calendar class for a alarm app with the alarm manager, but i have a error with the instance of the class calendar. i investiged in other forums but i not find poblem what is. please i need your help.

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


回答1:


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.




回答2:


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());



回答3:


I had the same problem, changed the import from android.icu.util.Calendar to java.util.Calendar and it work! hope it helps you!



来源:https://stackoverflow.com/questions/40540805/android-studio-stack-java-lang-noclassdeffounderror-failed-resolution-of-landr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!