Android Studio androidx.coordinatorlayout error and how to set up 3Dot Menu?

For androidx use following dependency

dependencies {
    implementation "androidx.coordinatorlayout:coordinatorlayout:1.1.0"
}

Ref - https://developer.android.com/jetpack/androidx/releases/coordinatorlayout


This will solve your first issue with coordinateLayout

implementation 'com.android.support:design:27.1.1'

Add this dependency to your app.gradle file

And this will also solve your issue with AppBarLayout

As the errors are clearly saying that you do not have the design package,

C:\Users\User\AndroidStudioProjects\BluetoothCar\app\src\main\java\com\car\bluetooth\bluetoothcar\MainActivity.java:11: error: **package android.support.design.widget does not exist**
import android.support.design.widget.AppBarLayout;

C:\Users\User\AndroidStudioProjects\BluetoothCar\app\src\main\java\com\car\bluetooth\bluetoothcar\MainActivity.java:12: error: **package android.support.v7.widget does not exist**
import android.support.v7.widget.Toolbar;

Edit:

Edit this portion

enter image description here

with

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'android.arch.navigation:navigation-fragment:1.0.0-alpha05'
implementation 'android.arch.navigation:navigation-ui:1.0.0-alpha05'

testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

There is a duplicate of appcompat and the other dependecies are not looking good with versions.