Cannot instantiate class android.support.v7.widget.SearchView

后端 未结 3 440
我在风中等你
我在风中等你 2021-01-07 20:08

Please somebody help me! I trying add appcompat search view to my project. Unsuccessfully. When I change android.support.v7.widget.SearchView to SearchView (API > 10) everyt

相关标签:
3条回答
  • 2021-01-07 20:14

    Problem was in bad v7 support library. After update everything fine.

    0 讨论(0)
  • 2021-01-07 20:28

    I had a similar probably that appeared on my release builds but not my debug builds when switching over to the v21 support library. Turned out to be an obfuscation problem, and adding this line to my proguard-rules.txt file fixed it:

    -keep class android.support.v7.widget.SearchView { *; }
    
    0 讨论(0)
  • 2021-01-07 20:31

    I had the same issue when I was using Android Studio and Gradle to build my project. I would like to add a SearchView of v7 compat.

    The solution is to change gradle plugin version from 0.9.1 or others to 0.9.0. It is a temporary way I found. It maybe a bug of gradle plugin. Hope that helps.

        dependencies {
            classpath "com.android.tools.build:gradle:0.9.0"
        }
    
    0 讨论(0)
提交回复
热议问题