Android SearchView does not work

Add following code to proguard-rules.pro

-keep class android.support.v7.widget.SearchView { *; }

Have you enabled Proguard in your build? If so, you may want to ensure that the appcompat libraries are in the Proguard exclusion list (in proguard.cfg). A brute force approach is to keep all the support library classes with:

   -keep class android.support.v4.app.** { *; }
   -keep interface android.support.v4.app.** { *; }
   -keep class android.support.v7.app.** { *; }
   -keep interface android.support.v7.app.** { *; }

In my case, I had a class that extended the support library's SearchView so I added this to my proguard.cfg:

-keep public class * extends android.support.v7.widget.SearchView {
   public <init>(android.content.Context);
   public <init>(android.content.Context, android.util.AttributeSet);
}

The constructors are specifically mentioned to avoid the error:

java.lang.NoSuchMethodException: <init> [class android.content.Context]