-5

I'm trying to learn Android through the tutorials at TheNewBoston.com. In the tutorial, I'm supposed to switch to the material light theme. That's when I get the error. It says:

Missing styles. Is the correct theme chosen for the layout?

Here's a screen shot:

Screenshot

Here's what I've tried:

  1. I've tried switching out of Android API 23, N preview for a lower API
  2. I've tried changing code in the styles.xml file from

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

    to

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

  3. I've tried invalidating the cache and restarting.

Nothing seems to be working. I'm very new at Android and just want to get the IDE set up correctly. I also get this message on startup and I think it's related to the error:

Related Error

Amit Vaghela
  • 22,772
  • 22
  • 86
  • 142
Taylor Liss
  • 593
  • 4
  • 27

4 Answers4

1

Change your layout Preview from API N to API 23. also select target and compile sdk version 23.

enter image description here

Change Compile sdk version and Build SDK version

enter image description here

Himanshu Shekher Jha
  • 1,334
  • 2
  • 14
  • 27
0

Have you added this line to your build.gradle file under dependencies

   compile 'com.android.support:appcompat-v7:23.2.1'

Note that the support version number might be higher for you. Add below line too to your depedencies

    compile 'com.android.support:design:23.2.1'
Ragesh Ramesh
  • 3,470
  • 2
  • 14
  • 20
0

In theme dropdown at the top of the graphical display of layout. change Theme.

check your theme in style than choose it in the layout too

OR

changed from Holo to Theme and the layout displayed and error disappeared.

check this answer for more detail

Community
  • 1
  • 1
Amit Vaghela
  • 22,772
  • 22
  • 86
  • 142
0

Reinstalling Android Studio and right-clicking the shortcut to run the program as administrator sorted out the problem.

Taylor Liss
  • 593
  • 4
  • 27