Skip to content Skip to sidebar Skip to footer

Can't Call Void Android.view.view.setelevation(float) On Null Object In Lapism/searchview

I am using library lapism/SearchView (https://github.com/lapism/SearchView) in my project but I get following runtime exception only on Android 5.0: A/art: art/runtime/check_jni.cc

Solution 1:

To fix this problem you have to update your XML file which contains SearchView and AppBarLayout. Add android:stateListAnimator="@null" to your AppBarLayout as shown below.

<android.support.design.widget.AppBarLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:stateListAnimator="@null">

It shows warning that android:stateListAnimator="@null" attribute stateListAnimator is only used in API level 21. But I've checked source code of the library and it crashes in the SearchBehavior class when it tries to set mAppBarLayout.setStateListAnimator(null);

EDIT

As was mention in comments below this issue is related more to the android components native crash on scrolling in RecyclerView+CollapsingToolbarLayout

Solution 2:

AppBarLayout's attribute app:elevation="..dp" helps to solve this problem

Post a Comment for "Can't Call Void Android.view.view.setelevation(float) On Null Object In Lapism/searchview"