thellmund / Android-Week-View

Display highly customizable calendar views in your Android app
Apache License 2.0
188 stars 98 forks source link

Null Pointer Exception on CalendarView #254

Closed ramseth001 closed 3 years ago

ramseth001 commented 3 years ago

Describe the bug I am receiving null pointer exception error on launching the activity that has calendarview. I have tried with two versions: 5.0.0 and 5.3.0 of CalendarView. I am receiving errors in both the versions. It's happening only on a particular device LG NEXUS v6.0 OS.

To Reproduce Steps to reproduce the behavior:

  1. Create an Activity with ConstraintLayout as base layout
  2. Insert CalendarView

Expected behavior The page should open normally.

Additional context

Error log

E/AndroidRuntime: FATAL EXCEPTION: main Process: com.platute.app, PID: 9375 java.lang.NullPointerException: Attempt to invoke virtual method 'int android.view.View.getVisibility()' on a null object reference at android.widget.LinearLayout.forceUniformHeight(LinearLayout.java:1409) at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:1397) at android.widget.TableRow.onMeasure(TableRow.java:113) at android.view.View.measure(View.java:18788) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1465) at android.widget.TableLayout.measureChildBeforeLayout(TableLayout.java:461) at android.widget.LinearLayout.measureVertical(LinearLayout.java:748) at android.widget.TableLayout.measureVertical(TableLayout.java:473) at android.widget.TableLayout.onMeasure(TableLayout.java:436) at android.view.View.measure(View.java:18788) at androidx.constraintlayout.widget.ConstraintLayout$Measurer.measure(ConstraintLayout.java:792) at androidx.constraintlayout.solver.widgets.analyzer.BasicMeasure.measure(BasicMeasure.java:480) at androidx.constraintlayout.solver.widgets.analyzer.BasicMeasure.measureChildren(BasicMeasure.java:134) at androidx.constraintlayout.solver.widgets.analyzer.BasicMeasure.solverMeasure(BasicMeasure.java:277) at androidx.constraintlayout.solver.widgets.ConstraintWidgetContainer.measure(ConstraintWidgetContainer.java:119) at androidx.constraintlayout.widget.ConstraintLayout.resolveSystem(ConstraintLayout.java:1578) at androidx.constraintlayout.widget.ConstraintLayout.onMeasure(ConstraintLayout.java:1690) at android.view.View.measure(View.java:18788) at androidx.constraintlayout.widget.ConstraintLayout$Measurer.measure(ConstraintLayout.java:792) at androidx.constraintlayout.solver.widgets.analyzer.BasicMeasure.measure(BasicMeasure.java:480) at androidx.constraintlayout.solver.widgets.analyzer.BasicMeasure.measureChildren(BasicMeasure.java:134) at androidx.constraintlayout.solver.widgets.analyzer.BasicMeasure.solverMeasure(BasicMeasure.java:277) at androidx.constraintlayout.solver.widgets.ConstraintWidgetContainer.measure(ConstraintWidgetContainer.java:119) at androidx.constraintlayout.widget.ConstraintLayout.resolveSystem(ConstraintLayout.java:1578) at androidx.constraintlayout.widget.ConstraintLayout.onMeasure(ConstraintLayout.java:1690) at android.view.View.measure(View.java:18788) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at androidx.appcompat.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:145) at android.view.View.measure(View.java:18788) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1465) at android.widget.LinearLayout.measureVertical(LinearLayout.java:748) at android.widget.LinearLayout.onMeasure(LinearLayout.java:630) at android.view.View.measure(View.java:18788) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at android.view.View.measure(View.java:18788) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1465) at android.widget.LinearLayout.measureVertical(LinearLayout.java:748) at android.widget.LinearLayout.onMeasure(LinearLayout.java:630) at android.view.View.measure(View.java:18788) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at com.android.internal.policy.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2643) at android.view.View.measure(View.java:18788) at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2100) at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1216) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1452) at android.view.V

thellmund commented 3 years ago

This looks like an issue in your layout, as WeekView isn’t popping up anywhere in the stacktrace.