[Solved] The following classes could not be found:

What causes the following error in the layout preview in Android Studio?

Rendering Problems The following classes could not be found:
– (Fix Build Path, Create Class)
Tip: Try to build the project.

Enquirer: Rahul


Solution #1:

The Actionbar has been deprecated and replaced by Toolbar. That being said, you can do the following if you want to continue using Actionbar for now:

  1. Open styles.xml in the values folder inside the res folder.
  2. Add the word Base to the beginning of the theme name so that it reads “Base.Theme.AppCompat.Light.DarkActionBar”

enter image description here

I had the same issue today and this solution worked for me. FYI I am in Android Studio though, but hopefully,the solution is similar for Eclipse.

FYI here is a decent blog post on replacing the Actionbar with the Toolbar for when you are ready to do so:

Respondent: joshgoldeneagle

Solution #2:

I think you must be depending on "" in your module settings.

ActionBar has been deprecated.

Just change your dependencies from '' to '' in “build.gradle”.

You can also change your style parent to "Theme.AppCompat.Light.NoActionBar".

Try to use the Toolbar instead of ActionBar.

Respondent: Handsome.Dou

Solution #3:

This one works for me

Changing AppTheme parent in res/values/styles.xml resolved this problem. Replace

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->


<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->

Or you can change API level 21 from list.

Respondent: Ravikant Paudel

Solution #4:

goto: res–>values–>styles(V21)–>


<style name="AppTheme.NoActionBar">
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
    <item name="android:windowDrawsSystemBarBackgrounds">true</item>
    <item name="android:statusBarColor">@android:color/transparent</item>

select your theme as Apptheme.NoActionBar in preview. Because ActionBar is depricated, welcome back to ToolBar. NO need to change your dependencies in build.gradle(Module:app).
from to

Hope this will help you!!!

Respondent: Narendra Baratam

Solution #5:

I had a similar issue, and as many have said since ActionBar has been deprecated the trick was to specify

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">

NOTE: that the parent ends in .NoActionBar.

Since ActionBar has been deprecated Android has gone into using ToolBar which you can read about here on the

I tried specifying

<style name="AppTheme.NoActionBar">

As a another post stated and that threw errors. Though others may not have that issue.

Respondent: john.weland

Solution #6:

I have the same problem in Android Studio 1.5 (even with AppCompatActivity), and my attempt to solve the problem was to update my Android Studio to 2.0. It solves the problem in my case. You can found the link download in:

Respondent: ninjahoahong

Solution #7:

thanks @joshgoldeneagle, worked in AS v1.4 for me. also effective in AS is to open “build.gradle (” and change version from v7.23.1.1 to v7.23.0.1 -hth

Respondent: uber

Solution #8:

Quick fix

Select a theme with no AtcionBar in UI Preview Tool
Pick image button
enter image description here

Respondent: vovahost

Solution #9:

You will need to change the api rendering level to 17, there may be rendering problem with higher level apis, might be higher level apis suppose to have a default theme, and hope you are not specified none.

enter image description here

Respondent: Bajrang Hudda

Solution #10:

For AS v1.4 adding “Base” before Theme.AppCompat.Light.DarkActionBar in the styles.xml folder solved the problem

Additionally, updating to AS v2.1 also solved the problem. Which is better likely depends on collaborators and their AS version.

Respondent: devin e

Solution #11:

In res/values/styles.xml, you will find your AppTheme as below :-

Change it to :-

by adding “Base” the rendering issue will get resolved.

Respondent: JayJoshi

Solution #12:

Changing the theme in the manifest solved my problem.

 <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
Respondent: Milon

The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 .

Most Popular

To Top
India and Pakistan’s steroid-soaked rhetoric over Kashmir will come back to haunt them both clenbuterol australia bossier man pleads guilty for leadership role in anabolic steriod distribution conspiracy