I am doing Navigation Drawable in Android Studio. I have error named cannot find symbol class actionbar and toolbar : I am making Sliding Menu in Navigation Drawable in Android Studio. But while adding toolbar and actionbar I get errors (`cannot find symbol class`).

    MainPageActivity.java
    import android.Manifest;

    import android.app.Activity;
     import android.content.Intent;
     import android.content.pm.PackageManager;
      import android.os.Bundle;
     import android.support.design.widget.NavigationView;
     import android.support.v4.view.GravityCompat;
     import android.support.v4.widget.DrawerLayout;
    import android.util.Log;
    import android.view.Menu;
    import android.view.MenuItem;
    import android.view.View;
     import android.widget.AdapterView;
     import android.widget.ImageView;
     import android.widget.ListView;



    public class MainPageActivity extends Activity {

    //slider_menu için *******************************************************///////////
    private DrawerLayout mDrawerLayout;

    /////////////////************************
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_mainpage);

        ///// ********************** toolbar -*************************
        mDrawerLayout = findViewById(R.id.drawer_layout);
        NavigationView navigationView = findViewById(R.id.nav_view);

        Toolbar toolbar = findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        ActionBar actionbar = getSupportActionBar();
        actionbar.setDisplayHomeAsUpEnabled(true);
        actionbar.setHomeAsUpIndicator(R.drawable.ic_menu);

        navigationView.setNavigationItemSelectedListener(
                new NavigationView.OnNavigationItemSelectedListener() {
                    @Override
                    public boolean onNavigationItemSelected(MenuItem menuItem) {
                        // set item as selected to persist highlight
                        menuItem.setChecked(true);
                        // close drawer when item is tapped
                        mDrawerLayout.closeDrawers();

                        // Add code here to update the UI based on the item selected
                        // For example, swap UI fragments here

                        return true;
                    }
                });

        /// **************************** Listen open and close slider menu button ******************************
        mDrawerLayout.addDrawerListener(
                new DrawerLayout.DrawerListener() {
                    @Override
                    public void onDrawerSlide(View drawerView, float slideOffset) {
                        // Respond when the drawer's position changes
                    }

                    @Override
                    public void onDrawerOpened(View drawerView) {
                        // Respond when the drawer is opened
                    }

                    @Override
                    public void onDrawerClosed(View drawerView) {
                        // Respond when the drawer is closed
                    }

                    @Override
                    public void onDrawerStateChanged(int newState) {
                        // Respond when the drawer motion state changes
                    }
                }
        );
        //**********************************************////////////////////
        ListView list;
        final String[] web = {
                getString(R.string.mainpage_acil),
                getString(R.string.mainpage_bildirim),
                getString(R.string.mainpage_isguveligi),

        };
        Integer[] imageId = {
                R.drawable.mainpage_acil_icon_p,
                R.drawable.mainpage_bildirim_icon_p,
                R.drawable.mainpage_isguvenligi_icon_p,
        };
        CustomListMainPage adapter = new
                CustomListMainPage(MainPageActivity.this, web, imageId);
        list = (ListView) findViewById(R.id.list);
        list.setAdapter(adapter);
        list.setOnItemClickListener(new AdapterView.OnItemClickListener() {

            @Override
            public void onItemClick(AdapterView<?> parent, View view,
                                    int position, long id) {
                //Toast.makeText(MainPageActivity.this, "You Clicked at " + web[+position], Toast.LENGTH_SHORT).show();
                Log.v("Pozisyon", String.valueOf(position));
                Intent intentPos;
                ImageView imageView= (ImageView) view.findViewById(R.id.img);
                boolean flag=false;
                /// Renk değiştirme buraya tekrar bak***************
                switch (position) {
                    case 0 :
                        //Toast.makeText(MainPageActivity.this, "You Clicked at " + web[+position], Toast.LENGTH_SHORT).show();
                        imageView.setImageResource(R.drawable.mainpage_acil_icon_p);
                        intentPos=new Intent(MainPageActivity.this,EmergencyActivity.class);
                        startActivity(intentPos);
                        break;

                    case 1 :
                        imageView.setImageResource(R.drawable.mainpage_bildirim_icon_p);
                        intentPos=new Intent(MainPageActivity.this,NotificationPage.class);
                        startActivity(intentPos);                     break;

                    case 2 :
                        imageView.setImageResource(R.drawable.mainpage_isguvenligi_icon_p);
                        intentPos=new Intent(MainPageActivity.this,JobSecurityActivity.class);
                        startActivity(intentPos);
                        break;

                    default :
                        System.out.println("Hatali secim! 1, 2 ya da 3'e basiniz.");
                        break;
                }
            }
        });
    }
    //slider_menu buton ayarları için *******************************************************///////////
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case android.R.id.home:
                mDrawerLayout.openDrawer(GravityCompat.START);
                return true;
        }
        return super.onOptionsItemSelected(item);
    }
    //slider_menu buton ayarları için 
      *******************************************************///////////
     }

I will also add my `build.gradle`.

    apply plugin: 'com.android.application'

         android {
         compileSdkVersion 27
           defaultConfig {
            applicationId "com.example.gokhan.emasapps"
        minSdkVersion 19
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        manifestPlaceholders = [HOCKEYAPP_APP_ID: "fcf64fa85c66428282796d0b1ed78ff1"]
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
       }
     }
      repositories {
       jcenter()
        maven { url "https://dl.bintray.com/drummer-aidan/maven" }
    }
      dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    implementation 'com.afollestad:material-camera:0.4.4'
    implementation 'net.hockeyapp.android:HockeySDK:5.1.0'


      }

             `activity_mainpage.xml`

         <?xml version="1.0" encoding="utf-8"?>
         <!-- Use DrawerLayout as root container for activity -->
         <android.support.v4.widget.DrawerLayout 
         xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
         android:id="@+id/drawer_layout"
         android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true"
         app:menu="@menu/menu_main"
        app:headerLayout="@layout/nav_header"
        android:orientation="vertical"
        android:background="#000000">


           !-- Layout to contain contents of main body of screen (drawer will slide over this) -->
            <FrameLayout
            android:id="@+id/content_frame"
            android:layout_width="match_parent"
            android:layout_height="match_parent" >
            <!-- Toolbar için ***********************************************-->
           <android.support.v7.widget.Toolbar
             android:id="@+id/toolbar"
            android:layout_width="match_parent"
             android:layout_height="?attr/actionBarSize"
              android:background="?attr/colorPrimary"
             android:theme="@style/ThemeOverlay.AppCompat.ActionBar" />
              <!-- Toolbar için *****************************************-->
              <!-- Container for contents of drawer - use NavigationView to make configuration easier -->
             <android.support.design.widget.NavigationView
             android:id="@+id/nav_view"
             android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_gravity="start"
             android:fitsSystemWindows="true" />
           </FrameLayout>

    
            <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
           android:orientation="vertical"
            android:weightSum="60"
            android:alpha=".85"
             android:background="@drawable/mainpage_background"
           android:layout_marginBottom="10dp">
           <LinearLayout

            android:layout_width="match_parent"
            android:layout_height="0dip"
            android:layout_weight="40"
            android:orientation="vertical">

            <TextView
                android:id="@+id/textView2"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="EMAS"
                android:textAlignment="center"
                android:textColor="@color/colorWhite"
                android:textSize="18sp"
                android:textStyle="bold" />
            </LinearLayout>

           <LinearLayout

            android:layout_width="match_parent"
            android:layout_height="0dip"
            android:orientation="vertical"
            android:layout_weight="20">

            <include layout="@layout/mainpage_inner_part" />
          </LinearLayout>
          </LinearLayout>

          </android.support.v4.widget.DrawerLayout>
    

Maybe I have problem in layout or only about gradle of app. I have tried appcombat.v4 and appcombatv7 versions for import. But problem didn't change. Please help me to solve this problem.
