6

How can i fix this red line? android.support.design.widget.CoordinatorLayout error did i miss something in my dependencies ?

enter image description here

enter image description here

this is my dependencies 

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    implementation 'androidx.core:core-ktx:1.3.0'
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.android.material:material:1.1.0'
    implementation 'androidx.recyclerview:recyclerview:1.1.0'
    implementation 'androidx.coordinatorlayout:coordinatorlayout:1.1.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    testImplementation 'junit:junit:4.13'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
}
2
  • Import the widgets from androidx or add the design support library in your dependencies. You should always add the error in the question itself and not in an image. Commented Jun 17, 2020 at 8:41
  • how do i import the Import the widgets from androidx? Commented Jun 17, 2020 at 8:46

1 Answer 1

25

You need to use androidx component

Use

<androidx.coordinatorlayout.widget.CoordinatorLayout

Instead of

<android.support.design.widget.CoordinatorLayout

Use

<androidx.recyclerview.widget.RecyclerView

Instead of

<android.support.v7.widget.RecyclerView

Use

<com.google.android.material.appbar.AppBarLayout
<androidx.appcompat.widget.Toolbar

Instead of

<android.support.design.widget.AppBarLayout
<android.support.v7.widget.Toolbar

For FloatingActionButton use

<com.google.android.material.floatingactionbutton.FloatingActionButton
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.