title: AppCompat widget that can only be used with a Theme.AppCompat theme (or descendant)
body: <p>iOS developer here thrown to the wolves of an Android project. I am getting a few error codes that all say something similar to <code>ThemeUtils: View class androidx.appcompat.widget.AppCompatTextView is an AppCompat widget that can only be used with a Theme.AppCompat theme (or descendant).</code> as soon as the following code snippet runs:</p>
  <pre><code>view = inflater.inflate(R.layout.f_basic_dashboard_screen, null, false)
  </code></pre>
  <p>My inflater is instantiated as follows:</p>
  <pre><code>val inflater: LayoutInflater = LayoutInflater.from(SqueaksApplication.getApplicationInstance())
  </code></pre>
  <p><code>SqueaksApplication.getApplicationInstance()</code> just returns an instance of <code>public class SqueaksApplication extends Application</code></p>
  <p>Almost every answer I have found to this question points to the project's manifest as the issue and needing to provide a theme for the project. My project's manifest looks like the following:</p>
  <pre><code>&lt;application
    android:name=&quot;.SqueaksApplication&quot;
    android:allowBackup=&quot;false&quot;
    android:icon=&quot;@mipmap/ic_launcher&quot;
    android:label=&quot;@string/app_name&quot;
    android:supportsRtl=&quot;true&quot;
    android:theme=&quot;@style/AppTheme&quot;
    android:usesCleartextTraffic=&quot;true&quot;
    tools:ignore=&quot;GoogleAppIndexingWarning,UnusedAttribute&quot;
    tools:replace=&quot;android:icon,android:allowBackup&quot;&gt;
  </code></pre>
  <p>As you can see my manifest already includes the line <code>android:theme=&quot;@style/AppTheme&quot;</code></p>
  <p>My project uses the layout inflator in many different places, but this is the only one I have come across that is throwing errors. Would appreciate any insight, or solutions you may have, thanks!</p>
  <p>Edit: As requested this is my styles.xml:</p>
  <pre><code>&lt;style name=&quot;MainActivityTheme&quot; parent=&quot;Theme.AppCompat.Light.NoActionBar&quot;&gt;
      &lt;item name=&quot;android:actionMenuTextColor&quot;&gt;#FFF&lt;/item&gt;
      &lt;item name=&quot;actionBarStyle&quot;&gt;@style/MainActivityTheme.Toolbar&lt;/item&gt;
      &lt;item name=&quot;actionBarTheme&quot;&gt;@style/MainActivityTheme.ToolbarOverlay&lt;/item&gt;
      &lt;item name=&quot;colorPrimary&quot;&gt;@color/colorPrimary&lt;/item&gt;
      &lt;item name=&quot;colorPrimaryDark&quot;&gt;@color/colorPrimaryDark&lt;/item&gt;
      &lt;item name=&quot;toolbarStyle&quot;&gt;@style/MainActivityTheme.Toolbar&lt;/item&gt;
      &lt;item name=&quot;colorAccent&quot;&gt;@color/colorAccent&lt;/item&gt;
      &lt;item name=&quot;android:textColorPrimary&quot;&gt;@color/text_primary&lt;/item&gt;
      &lt;item name=&quot;android:textColorSecondary&quot;&gt;@color/text_secondary&lt;/item&gt;
      &lt;item name=&quot;android:windowBackground&quot;&gt;@color/background&lt;/item&gt;
      &lt;item name=&quot;actionOverflowButtonStyle&quot;&gt;@style/MainActivityTheme.ActionOverflow&lt;/item&gt;
      &lt;item name=&quot;alertDialogTheme&quot;&gt;@style/AlertDialogTheme&lt;/item&gt;
  &lt;/style&gt;
  
  &lt;style name=&quot;AlertDialogTheme&quot; parent=&quot;Base.Theme.AppCompat.Light.Dialog.Alert&quot;&gt;
      &lt;item name=&quot;android:textColorPrimary&quot;&gt;#DE000000&lt;/item&gt;
      &lt;item name=&quot;colorAccent&quot;&gt;@color/colorAccent&lt;/item&gt;
  &lt;/style&gt;
  
  &lt;style name=&quot;MainActivityTheme.ActionOverflow&quot; parent=&quot;Base.Widget.AppCompat.ActionButton.Overflow&quot;&gt;
      &lt;item name=&quot;android:src&quot;&gt;@drawable/ic_settings&lt;/item&gt;
  &lt;/style&gt;
  
  &lt;style name=&quot;MainActivityTheme.Toolbar&quot; parent=&quot;Widget.AppCompat.ActionBar.Solid&quot;&gt;
      &lt;item name=&quot;background&quot;&gt;@color/colorPrimary&lt;/item&gt;
      &lt;item name=&quot;elevation&quot;&gt;4dp&lt;/item&gt;
      &lt;item name=&quot;titleTextAppearance&quot;&gt;@style/MainActivityTheme.ToolbarTextAppearance&lt;/item&gt;
      &lt;item name=&quot;android:textColorPrimary&quot;&gt;@android:color/white&lt;/item&gt;
      &lt;item name=&quot;android:textColorSecondary&quot;&gt;@android:color/white&lt;/item&gt;
  &lt;/style&gt;
  
  &lt;style name=&quot;MainActivityTheme.ToolbarOverlay&quot; parent=&quot;ThemeOverlay.AppCompat.ActionBar&quot;&gt;
      &lt;item name=&quot;android:textColorPrimary&quot;&gt;@android:color/white&lt;/item&gt;
      &lt;item name=&quot;android:textColorSecondary&quot;&gt;@android:color/white&lt;/item&gt;
  &lt;/style&gt;
  
  &lt;style name=&quot;MainActivityTheme.ToolbarTextAppearance&quot; parent=&quot;TextAppearance.AppCompat.Title&quot;&gt;
      &lt;item name=&quot;android:textColor&quot;&gt;#81be41&lt;/item&gt;
      &lt;item name=&quot;android:textSize&quot;&gt;16sp&lt;/item&gt;
      &lt;item name=&quot;android:textStyle&quot;&gt;bold&lt;/item&gt;
  &lt;/style&gt;
  
  &lt;style name=&quot;AppTheme&quot; parent=&quot;Theme.AppCompat.Light.NoActionBar&quot;&gt;
      &lt;item name=&quot;android:actionMenuTextColor&quot;&gt;#FFF&lt;/item&gt;
      &lt;item name=&quot;actionBarStyle&quot;&gt;@style/Toolbar&lt;/item&gt;
      &lt;item name=&quot;actionBarTheme&quot;&gt;@style/ToolbarOverlay&lt;/item&gt;
      &lt;item name=&quot;colorPrimary&quot;&gt;@color/colorPrimary&lt;/item&gt;
      &lt;item name=&quot;colorPrimaryDark&quot;&gt;@color/colorPrimaryDark&lt;/item&gt;
      &lt;item name=&quot;colorAccent&quot;&gt;@color/colorAccent&lt;/item&gt;
      &lt;item name=&quot;toolbarStyle&quot;&gt;@style/Toolbar&lt;/item&gt;
      &lt;item name=&quot;android:textColorPrimary&quot;&gt;@color/text_primary&lt;/item&gt;
      &lt;item name=&quot;android:textColorSecondary&quot;&gt;@color/text_secondary&lt;/item&gt;
      &lt;item name=&quot;android:windowBackground&quot;&gt;@color/background&lt;/item&gt;
      &lt;item name=&quot;actionOverflowButtonStyle&quot;&gt;@style/ActionOverflow&lt;/item&gt;
      &lt;item name=&quot;alertDialogTheme&quot;&gt;@style/AlertDialogTheme&lt;/item&gt;
  &lt;/style&gt;
  
  &lt;style name=&quot;AppTheme.Dark&quot; parent=&quot;Theme.AppCompat.NoActionBar&quot;&gt;
      &lt;item name=&quot;colorPrimary&quot;&gt;@color/colorPrimary&lt;/item&gt;
      &lt;item name=&quot;colorPrimaryDark&quot;&gt;@color/colorPrimaryDark&lt;/item&gt;
      &lt;item name=&quot;android:windowBackground&quot;&gt;@color/colorPrimary&lt;/item&gt;
      &lt;item name=&quot;colorAccent&quot;&gt;@color/colorAccent&lt;/item&gt;
  &lt;/style&gt;
  
  &lt;style name=&quot;ActionOverflow&quot; parent=&quot;Base.Widget.AppCompat.ActionButton.Overflow&quot;&gt;
      &lt;item name=&quot;android:src&quot;&gt;@drawable/ic_dots_vertical_white&lt;/item&gt;
  &lt;/style&gt;
  
  &lt;style name=&quot;Toolbar&quot; parent=&quot;Widget.AppCompat.ActionBar.Solid&quot;&gt;
      &lt;item name=&quot;background&quot;&gt;@color/colorPrimary&lt;/item&gt;
      &lt;item name=&quot;elevation&quot;&gt;4dp&lt;/item&gt;
      &lt;item name=&quot;titleTextAppearance&quot;&gt;@style/ToolbarTextAppearance&lt;/item&gt;
      &lt;item name=&quot;android:textColorPrimary&quot;&gt;@android:color/white&lt;/item&gt;
      &lt;item name=&quot;android:textColorSecondary&quot;&gt;@android:color/white&lt;/item&gt;
  &lt;/style&gt;
  
  &lt;style name=&quot;ToolbarOverlay&quot; parent=&quot;ThemeOverlay.AppCompat.ActionBar&quot;&gt;
      &lt;item name=&quot;android:textColorPrimary&quot;&gt;@android:color/white&lt;/item&gt;
      &lt;item name=&quot;android:textColorSecondary&quot;&gt;@android:color/white&lt;/item&gt;
  &lt;/style&gt;
  
  &lt;style name=&quot;ToolbarTextAppearance&quot; parent=&quot;TextAppearance.AppCompat.Title&quot;&gt;
      &lt;item name=&quot;android:textColor&quot;&gt;#81be41&lt;/item&gt;
      &lt;item name=&quot;android:textSize&quot;&gt;20sp&lt;/item&gt;
  &lt;/style&gt;
  
  &lt;style name=&quot;Splash&quot; parent=&quot;Theme.AppCompat.NoActionBar&quot;&gt;
      &lt;item name=&quot;android:windowBackground&quot;&gt;@drawable/background_splash&lt;/item&gt;
  &lt;/style&gt;
  
  &lt;style name=&quot;squeak_item_popup_menu_animation&quot;&gt;
      &lt;item name=&quot;android:windowEnterAnimation&quot;&gt;@anim/squeak_item_popup_menu_animation_enter&lt;/item&gt;
      &lt;item name=&quot;android:windowExitAnimation&quot;&gt;@anim/squeak_item_popup_menu_animation_exit&lt;/item&gt;
  &lt;/style&gt;
  
  &lt;style name=&quot;Theme.Transparent&quot; parent=&quot;Theme.AppCompat.Light.NoActionBar&quot;&gt;
      &lt;item name=&quot;android:windowIsTranslucent&quot;&gt;true&lt;/item&gt;
      &lt;item name=&quot;android:windowBackground&quot;&gt;@android:color/transparent&lt;/item&gt;
      &lt;item name=&quot;android:windowContentOverlay&quot;&gt;@null&lt;/item&gt;
      &lt;item name=&quot;android:windowNoTitle&quot;&gt;true&lt;/item&gt;
      &lt;item name=&quot;android:windowIsFloating&quot;&gt;true&lt;/item&gt;
      &lt;item name=&quot;android:backgroundDimEnabled&quot;&gt;false&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>