material-calendarview
material-calendarview copied to clipboard
Exception in editor mode (preview not work)
The following classes could not be instantiated: - com.prolificinteractive.materialcalendarview.MaterialCalendarView
java.lang.NullPointerException
at com.prolificinteractive.materialcalendarview.MaterialCalendarView.setupChildren(MaterialCalendarView.java:425)
at com.prolificinteractive.materialcalendarview.MaterialCalendarView.<init>(MaterialCalendarView.java:404)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.jetbrains.android.uipreview.ViewLoader.createNewInstance(ViewLoader.java:401)
at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:184)
at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:142)
at com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadView(LayoutlibCallbackImpl.java:229)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:421)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:432)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:336)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:863)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:72)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:837)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:394)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:327)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:386)
at com.android.tools.idea.layoutlib.LayoutLibrary.createSession(LayoutLibrary.java:193)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:450)
at com.android.tools.idea.rendering.RenderTask.lambda$inflate$3(RenderTask.java:590)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
same problme here.
Most likely a problem with styles or android studio, not the library.
same here
same problem for me. Android studio is reaching max memory capacity and not responding. 3889 of 3933M with com.prolificinteractive.materialcalendarview.MaterialCalendarView
same here.
Same here.
Same here (edit) i solved problem for me, using version 1.6.0 instead of 2.0.1, curiously 1.6.1 and above not works (had the same problem)
With last version of AS, it did not design rendering even on these versions:
- 2.0.1
- 2.0.0
- 1.6.0
- 1.4.3
Same problem here. This is the stack trace on AS 3.4 and gradle tools version 3.4.0:
java.lang.NoClassDefFoundError: Could not initialize class com.prolificinteractive.materialcalendarview.format.TitleFormatter
at com.prolificinteractive.materialcalendarview.TitleChanger.
Still getting the null pointer exception above (though for line 427) in Android Studio 3.5 beta. NPE seems to line up with the calendarMode field. Setting the calendar mode explicitly on the view with app:mcv_calendarMode="month" seems to have no effect here.
Edit: Using library version 2.0.1
Same problem here, any updates?
There hasn't been a master commit since Jan 24, 2019... I think this repo is no longer being maintained
So, I discovered the fix on the Design Editor problem.
I downloaded the source code and opened up Android Studio. Then I tried to separate the calendarMode variable from the state builder, then instantiate it like this; calendarMode = CalendarMode.values()[calendarModeIndex];
Then I built the project, and a org.threeten.bp.zone.ZoneRulesException: No time-zone data files registered occurred, and googled about that exception and found this.
After finding the answer, adding the missing statement, and returning the state builder back. A new exception popped up (As of writing this, it didn't occurred, but it did happened);
java.lang.NullPointerException
at com.prolificinteractive.materialcalendarview.TitleChanger.change(TitleChanger.java:59)
So I tried to add a != null on the if statement, and it worked!
I don't know if this is breaking the license or something, but alot of people including me is having this problem, but I'm not gonna use my version of the library and I'm gonna wait for the update.