facebookarchive / stetho

Stetho is a debug bridge for Android applications, enabling the powerful Chrome Developer Tools and much more.
http://facebook.github.io/stetho/
MIT License
12.66k stars 1.13k forks source link

Crash when inspecting a ListPreference/MultiSelectListPreference #618

Closed afollestad closed 5 years ago

afollestad commented 5 years ago

While using Stetho in the sample project of one of my open source libraries, I noticed a crash.

The crash:

Process: com.afollestad.aestheticsample, PID: 8673
java.lang.IllegalArgumentException: Invalid Region.Op - only INTERSECT and DIFFERENCE are allowed
        at android.graphics.Canvas.checkValidClipOp(Canvas.java:779)
        at android.graphics.Canvas.clipRect(Canvas.java:826)
        at com.facebook.stetho.inspector.elements.android.ViewHighlightOverlays$ViewHighlightOverlaysJellybeanMR2$MainHighlightDrawable.draw(ViewHighlightOverlays.java:141)
        at android.view.ViewOverlay$OverlayViewGroup.dispatchDraw(ViewOverlay.java:256)

This is the visual layout:

I get a crash when inspecting a MultiSelectListPreference, I'm using an AndroidX PreferenceFragmentCompat, not sure if it would happen in the legacy Support Library's as well.


I've made the contents below expandable so it's not overwhelming to look at, at first glance.

The preferences XML:

```xml ```

The code that uses the preferences XML:

```kotlin import android.os.Bundle import androidx.preference.PreferenceFragmentCompat import com.afollestad.aesthetic.AestheticActivity class SettingsFragment : PreferenceFragmentCompat() { override fun onCreatePreferences( savedInstanceState: Bundle?, rootKey: String? ) = setPreferencesFromResource(R.xml.preferences, rootKey) } class SettingsActivity : AestheticActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_settings) if (savedInstanceState == null) { supportFragmentManager .beginTransaction() .add(R.id.container, SettingsFragment()) .commit() } } } ```
jasta commented 5 years ago

Duplicate of #607. Fixed in v1.5.1 which just released.