I have tried each and every solution from the SO, but my problem still isn't solved. Following is the error I am getting:
The following classes could not be found: - android.support.v4.widget.DrawerLayout (Fix Build Path, Create Class) Tip: Try to build the project.
I am just exporting this android project into android studio(1.2). I have applied this solution and many other , but with no success.
You Need To change the API level from 5.1.1 to 5.0.1.it is on upper right side corner in design of xml.:)
Android Studio's XML editor preview will give you that error whenever you use a "custom" view - be it third-party library views or Google's own
DrawerLayout
, as you've experienced yourself.But fear not, that error will only be shown on the XML preview, your project should compile just fine. Go ahead and try. :)
Hope this helped!
p.s., Switching API level on the editor (as suggested by an answer here) helps fix API 22 rendering error for "normal" in-build views, but not for
DrawerLayout
or any other third-party views really.