title: Error inflating class androidx.appcompat.widget.Toolbar android
body: <p>I try to use the toolbar in my app and I get this message: &quot;Error inflating class androidx.appcompat.widget.Toolbar&quot;.
  i glad if someone will find my problem (using the latest version of the android studio)</p>
  <p>XML:</p>
  <pre><code>  &lt;androidx.appcompat.widget.Toolbar
          android:layout_width=&quot;0dp&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:background=&quot;#00008577&quot;
          android:minHeight=&quot;?actionBarTheme&quot;
          app:layout_constraintEnd_toEndOf=&quot;parent&quot;
          app:layout_constraintStart_toStartOf=&quot;parent&quot;
          app:layout_constraintTop_toTopOf=&quot;parent&quot;
          app:navigationIcon=&quot;@drawable/main&quot;
          android:id=&quot;@+id/toolbar&quot;/&gt;
  </code></pre>
  <p>JAVA:</p>
  <pre><code>
      private Toolbar toolbar;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          findViews();
          setSupportActionBar(toolbar);
  
      }
  
      private void findViews() {
          drawer_layout = findViewById(R.id.drawer_layout);
          nav_view = findViewById(R.id.nav_view);
          toolbar = findViewById(R.id.toolbar);
      }
  </code></pre>
  <p>STYLE:
  <code> &lt;style name=&quot;AppTheme&quot; parent=&quot;Theme.MaterialComponents.DayNight.NoActionBar&quot;&gt;</code></p>
  <p>Exception received</p>
  <pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.or.ourshoppinglist/com.or.ourshoppinglist.MainActivity}: android.view.InflateException: Binary XML file line #28: Binary XML file line #28: Error inflating class &lt;unknown&gt;
  </code></pre>