0

When I create Navigation Drawer Activity, and some xml files are not working and it gives me error like this when I open .xml files..

The following classes could not be found:

- android.support.design.widget.AppBarLayout (Fix Build Path, Edit XML, Create Class)
- android.support.design.widget.CoordinatorLayout (Fix Build Path, Edit XML, Create Class)
- android.support.design.widget.FloatingActionButton (Fix Build Path, Edit XML, Create Class)
- android.support.v7.widget.RecyclerView (Fix Build Path, Edit XML, Create Class)
- android.support.v7.widget.Toolbar (Fix Build Path, Edit XML, Create Class)

Tip: Try to build the project. Tip: Try to refresh the layout.

v

3
  • Have you added related design library dependencies in your build.gradle? Commented Apr 12, 2020 at 4:16
  • Nope and I don't know what it is!!! :) :( :(.. Commented Apr 12, 2020 at 18:52
  • Please paste your build.gradle(Module app) file Commented Apr 13, 2020 at 4:08

1 Answer 1

0

change your packages to these packages:

androidx.coordinatorlayout.widget.CoordinatorLayout
com.google.android.material.appbar.AppBarLayout
com.google.android.material.appbar.CollapsingToolbarLayout
androidx.appcompat.widget.Toolbar

also add in your gradle

implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'

Also check this question

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks dear bro!!!!! and now the problems from .java classes resolved but the .xml files are still the same and showing their drawers... please click on ' v ' symbol.

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.