Android: SearchableInfo is null when using packageNameSuffix in Gradle build script
问题 I encountered that the method getSearchableInfo always returns null during SearchView initialization if I use the packageNameSuffix in the project's Gradle build script. SearchView initialization: final SearchManager searchManager = (SearchManager) context.getSystemService(Context.SEARCH_SERVICE); SearchableInfo info = searchManager.getSearchableInfo(componentName); mSearchView.setSearchableInfo(info); Project's build.gradle: android { [...] buildTypes { debug { packageNameSuffix ".debug"