Search code examples
androidxmlsearchview

Fix build path error in searchable configuration xml file


I'm trying to add searchview to my android application using android studio but when I first add the searchable.xml configuration file I get this error

the fallowing classes could not be found: -searchable (fix build path,edit xml) and layout missing attributes

When I build the project I get this errors : -no resource found that matches the given name(at 'resource' with value @searchable.xml) -execution failed for task ':app.processDebugProcess'

Any help??

enter code here<?xml version="1.0" encoding="utf-8"?>

android:label="@string/search_label"
android:hint="@string/hint_search"
 />

Solution

  • The searchable.xml file should be on res/xml folder and should look like this:

    <?xml version="1.0" encoding="utf-8"?>
    <searchable xmlns:android="http://schemas.android.com/apk/res/android"
        android:hint="@string/hint_search"
        android:label="@string/search_label" >
    </searchable>