This is my code for main_activity.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<com.google.android.material.navigation.NavigationView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="start"
app:headerLayout="@layout/header"
app:menu="@menu/menu_drawer" />
</androidx.drawerlayout.widget.DrawerLayout>
When I try to add <android...toolbar> here it doesn't prompt any suggestions, including layout_width/height. When I manually fill them in, nothing shows up on the screen. Same with TextView.
I tried restarting the IDE and re-syncing the gradle but nothing.
Why don't you try it this way? I'll give you my code related to this. It worked for me.