title: How to fix crash on only Huawei devices in android.widget.SearchView
body: <pre><code>Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.***.***/com.***.***.activities.SearchActivity}: android.view.InflateException: Binary XML file line #29: Binary XML file line #29: Error inflating class android.widget.SearchView
     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2451)
     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2511)
     at android.app.ActivityThread.access$900(ActivityThread.java:165)
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1375)
     at android.os.Handler.dispatchMessage(Handler.java:102)
     at android.os.Looper.loop(Looper.java:150)
     at android.app.ActivityThread.main(ActivityThread.java:5621)
     at java.lang.reflect.Method.invoke(Method.java)
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)
  
  
  
  Caused by java.lang.reflect.InvocationTargetException
     at java.lang.reflect.Constructor.newInstance(Constructor.java)
     at android.view.LayoutInflater.createView(LayoutInflater.java:638)
     at com.mikepenz.iconics.context.InternalLayoutInflater.onCreateView(InternalLayoutInflater.java:54)
     at android.view.LayoutInflater.onCreateView(LayoutInflater.java:713)
     at com.mikepenz.iconics.context.InternalLayoutInflater.onCreateView(InternalLayoutInflater.java:70)
     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:781)
     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:723)
     at android.view.LayoutInflater.rInflate(LayoutInflater.java:854)
     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:817)
     at android.view.LayoutInflater.rInflate(LayoutInflater.java:857)
     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:817)
     at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
     at com.mikepenz.iconics.context.InternalLayoutInflater.inflate(InternalLayoutInflater.java:81)
     at android.view.LayoutInflater.inflate(LayoutInflater.java:434)
     at android.view.LayoutInflater.inflate(LayoutInflater.java:377)
     at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
     at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
     at com.***.***.activities.SearchActivity.onCreate(SearchActivity.java:124)
     at android.app.Activity.performCreate(Activity.java:6367)
     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1110)
     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2404)
     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2511)
     at android.app.ActivityThread.access$900(ActivityThread.java:165)
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1375)
     at android.os.Handler.dispatchMessage(Handler.java:102)
     at android.os.Looper.loop(Looper.java:150)
     at android.app.ActivityThread.main(ActivityThread.java:5621)
     at java.lang.reflect.Method.invoke(Method.java)
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)
  
  Caused by android.view.InflateException: Binary XML file line #79: Binary XML file line #79: Error inflating class android.widget.SearchView$SearchAutoComplete
     at android.view.LayoutInflater.inflate(LayoutInflater.java:558)
     at com.mikepenz.iconics.context.InternalLayoutInflater.inflate(InternalLayoutInflater.java:81)
     at android.view.LayoutInflater.inflate(LayoutInflater.java:434)
     at android.widget.SearchView.inflateSearchView(SearchView.java:1847)
     at android.widget.SearchView.(SearchView.java:268)
     at android.widget.SearchView.(SearchView.java:259)
     at android.widget.SearchView.(SearchView.java:255)
     at java.lang.reflect.Constructor.newInstance(Constructor.java)
     at android.view.LayoutInflater.createView(LayoutInflater.java:638)
     at com.mikepenz.iconics.context.InternalLayoutInflater.onCreateView(InternalLayoutInflater.java:54)
     at android.view.LayoutInflater.onCreateView(LayoutInflater.java:713)
     at com.mikepenz.iconics.context.InternalLayoutInflater.onCreateView(InternalLayoutInflater.java:70)
     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:781)
     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:723)
     at android.view.LayoutInflater.rInflate(LayoutInflater.java:854)
     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:817)
     at android.view.LayoutInflater.rInflate(LayoutInflater.java:857)
     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:817)
     at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
     at com.mikepenz.iconics.context.InternalLayoutInflater.inflate(InternalLayoutInflater.java:81)
     at android.view.LayoutInflater.inflate(LayoutInflater.java:434)
     at android.view.LayoutInflater.inflate(LayoutInflater.java:377)
     at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
     at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
     at com.***.***.activities.SearchActivity.onCreate(SearchActivity.java:124)
     at android.app.Activity.performCreate(Activity.java:6367)
     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1110)
     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2404)
     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2511)
     at android.app.ActivityThread.access$900(ActivityThread.java:165)
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1375)
     at android.os.Handler.dispatchMessage(Handler.java:102)
     at android.os.Looper.loop(Looper.java:150)
     at android.app.ActivityThread.main(ActivityThread.java:5621)
     at java.lang.reflect.Method.invoke(Method.java)
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)
  
  Caused by android.view.InflateException: Binary XML file line #79: Error inflating class android.widget.SearchView$SearchAutoComplete
     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:801)
     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:723)
     at android.view.LayoutInflater.rInflate(LayoutInflater.java:854)
     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:817)
     at android.view.LayoutInflater.rInflate(LayoutInflater.java:857)
     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:817)
     at android.view.LayoutInflater.rInflate(LayoutInflater.java:857)
     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:817)
     at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
     at com.mikepenz.iconics.context.InternalLayoutInflater.inflate(InternalLayoutInflater.java:81)
     at android.view.LayoutInflater.inflate(LayoutInflater.java:434)
     at android.widget.SearchView.inflateSearchView(SearchView.java:1847)
     at android.widget.SearchView.(SearchView.java:268)
     at android.widget.SearchView.(SearchView.java:259)
     at android.widget.SearchView.(SearchView.java:255)
     at java.lang.reflect.Constructor.newInstance(Constructor.java)
     at android.view.LayoutInflater.createView(LayoutInflater.java:638)
     at com.mikepenz.iconics.context.InternalLayoutInflater.onCreateView(InternalLayoutInflater.java:54)
     at android.view.LayoutInflater.onCreateView(LayoutInflater.java:713)
     at com.mikepenz.iconics.context.InternalLayoutInflater.onCreateView(InternalLayoutInflater.java:70)
     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:781)
     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:723)
     at android.view.LayoutInflater.rInflate(LayoutInflater.java:854)
     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:817)
     at android.view.LayoutInflater.rInflate(LayoutInflater.java:857)
     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:817)
     at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
     at com.mikepenz.iconics.context.InternalLayoutInflater.inflate(InternalLayoutInflater.java:81)
     at android.view.LayoutInflater.inflate(LayoutInflater.java:434)
     at android.view.LayoutInflater.inflate(LayoutInflater.java:377)
     at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
     at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
     at com.***.***.activities.SearchActivity.onCreate(SearchActivity.java:124)
     at android.app.Activity.performCreate(Activity.java:6367)
     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1110)
     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2404)
     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2511)
     at android.app.ActivityThread.access$900(ActivityThread.java:165)
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1375)
     at android.os.Handler.dispatchMessage(Handler.java:102)
     at android.os.Looper.loop(Looper.java:150)
     at android.app.ActivityThread.main(ActivityThread.java:5621)
     at java.lang.reflect.Method.invoke(Method.java)
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)
  
  Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.widget.SearchView.isInActionMode()' on a null object reference
     at android.widget.SearchView$SearchAutoComplete.enoughToFilter(SearchView.java:1801)
     at android.widget.AutoCompleteTextView.doAfterTextChanged(AutoCompleteTextView.java:781)
     at android.widget.AutoCompleteTextView$MyWatcher.afterTextChanged(AutoCompleteTextView.java:749)
     at android.widget.TextView.sendAfterTextChanged(TextView.java:8232)
     at android.widget.TextView.setText(TextView.java:4435)
     at android.widget.TextView.setText(TextView.java:4283)
     at android.widget.EditText.setText(EditText.java:84)
     at android.widget.TextView.setText(TextView.java:4258)
     at com.mikepenz.iconics.Iconics$IconicsBuilderView.build(Iconics.java:297)
     at com.mikepenz.iconics.context.IconicsFactory.onViewCreatedInternal(IconicsFactory.java:50)
     at com.mikepenz.iconics.context.IconicsFactory.onViewCreated(IconicsFactory.java:27)
     at com.mikepenz.iconics.context.InternalLayoutInflater$PrivateWrapperFactory2.onCreateView(InternalLayoutInflater.java:245)
     at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:189)
     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:773)
     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:723)
     at android.view.LayoutInflater.rInflate(LayoutInflater.java:854)
     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:817)
     at android.view.LayoutInflater.rInflate(LayoutInflater.java:857)
     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:817)
     at android.view.LayoutInflater.rInflate(LayoutInflater.java:857)
     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:817)
     at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
     at com.mikepenz.iconics.context.InternalLayoutInflater.inflate(InternalLayoutInflater.java:81)
     at android.view.LayoutInflater.inflate(LayoutInflater.java:434)
     at android.widget.SearchView.inflateSearchView(SearchView.java:1847)
     at android.widget.SearchView.(SearchView.java:268)
     at android.widget.SearchView.(SearchView.java:259)
     at android.widget.SearchView.(SearchView.java:255)
     at java.lang.reflect.Constructor.newInstance(Constructor.java)
     at android.view.LayoutInflater.createView(LayoutInflater.java:638)
     at com.mikepenz.iconics.context.InternalLayoutInflater.onCreateView(InternalLayoutInflater.java:54)
     at android.view.LayoutInflater.onCreateView(LayoutInflater.java:713)
     at com.mikepenz.iconics.context.InternalLayoutInflater.onCreateView(InternalLayoutInflater.java:70)
     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:781)
     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:723)
     at android.view.LayoutInflater.rInflate(LayoutInflater.java:854)
     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:817)
     at android.view.LayoutInflater.rInflate(LayoutInflater.java:857)
     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:817)
     at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
     at com.mikepenz.iconics.context.InternalLayoutInflater.inflate(InternalLayoutInflater.java:81)
     at android.view.LayoutInflater.inflate(LayoutInflater.java:434)
     at android.view.LayoutInflater.inflate(LayoutInflater.java:377)
     at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
     at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
     at com.***.***.activities.SearchActivity.onCreate(SearchActivity.java:124)
     at android.app.Activity.performCreate(Activity.java:6367)
     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1110)
     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2404)
     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2511)
     at android.app.ActivityThread.access$900(ActivityThread.java:165)
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1375)
     at android.os.Handler.dispatchMessage(Handler.java:102)
     at android.os.Looper.loop(Looper.java:150)
     at android.app.ActivityThread.main(ActivityThread.java:5621)
     at java.lang.reflect.Method.invoke(Method.java)
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)
  </code></pre>
  
  <p>According to the log its happening in the oncreate of activity when trying to inflate the searchview. I am using 'android.widget.SearchView' instead of appcompat because I am animating it and can't get the appcompat version to animate properly. </p>
  
  <p>I do not feel this is an animate issue though. I cannot figure out why its only happening on Huawei devices. I released this update last week and its already on 100k plus devices. According to Crashlytics its 100% Huawei and 81% Android 8, 15% Android 7 and 4% Android 6.</p>
  
  <p>I have tried try/catches on the start activity, on create and few other places but nothing catches it. I can post code if needed but wanted to see if it was necessary.</p>
  
  <p>Here is the searchview in the layout</p>
  
  <pre><code> &lt;SearchView
          android:id="@+id/search_view"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:alpha="0"
          android:iconifiedByDefault="false"/&gt;
  </code></pre>
  
  <p>And this is initializing the searchview in oncreate</p>
  
  <pre><code> SearchManager searchManager = (SearchManager) getSystemService(SEARCH_SERVICE);
      if (searchManager != null) {
          searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
      }
  </code></pre>
  
  <p>Setting setSearchableInfo is calling updateSearchAutoComplete() which is where the crash starts. But i have tried a try/catch there an still crashes.</p>