The feature/src/main/res/xml/searchable.xml:
<?xml version="1.0" encoding="utf-8"?>
<searchable xmlns:android="http://schemas.android.com/apk/res/android"
android:label="@string/app_name"
android:hint="@string/search_hint" >
<!-- TODO https://developer.android.com/guide/topics/search/searchable-config -->
</searchable>
is not found in my instant app on the build, nothing is in the base module except the styles. Error output line is:
AGPBI: {"kind":"error","text":"error: resource xml/searchable (aka at.mts.arnatomy.app:xml/searchable) not found.","sources":[{"file":"./arnatomy/base/build/intermediates/manifests/full/feature/debug/AndroidManifest.xml","position":{"startLine":53}}],"original":"","tool":"AAPT"}
The corresponding action in the feature/src/main/AndroidManifest.xml:
<activity
android:name=".SearchableActivity"
android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data android:name="android.app.searchable"
android:resource="@xml/searchable"/>
</activity>
The layout of the corresponding text field in is feature/src/main/res/layout/search.xml:
...
<android.support.v7.widget.AppCompatEditText
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="@string/search_hint"
android:imeOptions="actionSearch"
android:inputType="text"
android:layout_weight="1"/>
...
And the related code of the feature/src/main/java/SearchableActivity.java is:
...
AppCompatEditText text = findViewById(R.id.text);
text.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
boolean handled = false;
if (actionId == EditorInfo.IME_ACTION_SEND) {
doMySearch(v.getText().toString());
handled = true;
}
return handled;
}
});
...
where the method doMySerach just prints a Toast. minSdkVersion is 24 and target- as well as compileSdkVersion are 27. How can the searchable.xml file be not found? I also tried to but the xml folder in the base module, still no success.