Rendering problems, could not find android.support

2019-08-12 07:35发布

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.

2条回答
Evening l夕情丶
2楼-- · 2019-08-12 08:23

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.:)

查看更多
等我变得足够好
3楼-- · 2019-08-12 08:26

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.

查看更多
登录 后发表回答