Open ttooyy opened 3 months ago
Did this happen just once, or does it happen multiple times?
val countView = view.findViewById<TextView>(R.id.leak_canary_count_text)
val projection = projections[position]
countView.isEnabled = projection.isNew
Looks like findViewById
here returned null, which is unexpected as it's inflated from R.layout.leak_canary_leak_row
which itself has this text view:
<TextView
android:id="@+id/leak_canary_count_text"
android:layout_width="56dp"
android:layout_height="56dp"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="20dp"
android:background="@drawable/leak_canary_count_background"
android:gravity="center"
android:padding="16dp"
android:textColor="@color/leak_canary_count_text"
android:textSize="18sp"
android:textStyle="bold"
tools:text="1"
/>
Is there anything special going on with your build or your device? Can you reproduce this error on a sample project?
Crash and can't open
E FATAL EXCEPTION: main Process: com.oplus.melody, PID: 16325 java.lang.IllegalStateException: countView must not be null at leakcanary.internal.activity.screen.LeaksScreen$onGroupsRetrieved$1.invoke(LeaksScreen.kt:57) at leakcanary.internal.activity.screen.LeaksScreen$onGroupsRetrieved$1.invoke(LeaksScreen.kt:24) at leakcanary.internal.activity.ui.SimpleListAdapter.getView(SimpleListAdapter.kt:19) at android.widget.AbsListView.obtainView(AbsListView.java:2482)