The following classes could not be found: android.support.v7.internal.app.WindowDecorActionBar

Rahul picture Rahul · Nov 16, 2015 · Viewed 72.8k times · Source

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

Rendering Problems The following classes could not be found: - android.support.v7.internal.app.WindowDecorActionBar (Fix Build Path, Create Class) Tip: Try to build the project.

Answer

joshgoldeneagle picture joshgoldeneagle · Nov 16, 2015

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: https://blog.xamarin.com/android-tips-hello-toolbar-goodbye-action-bar/