Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash and can't open #2689

Open
ttooyy opened this issue Jun 17, 2024 · 1 comment
Open

Crash and can't open #2689

ttooyy opened this issue Jun 17, 2024 · 1 comment

Comments

@ttooyy
Copy link

ttooyy commented Jun 17, 2024

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)

@pyricau
Copy link
Member

pyricau commented Jun 20, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants