Hello! I want to use the Theme.AppCompat theme in the application for correctly displaying the icons on the action bar. But it does not work, an error:

Error: (360) Error retrieving the found name 'android: Theme.AppCompat'.

C dependencies everything seems to be fine:

dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:25.0.1' 

But in Android Studio everything is lit in red enter image description here

In this case, you can open the theme editor, see how this topic looks, but for some reason it is not located during assembly.

PS The need arose for the same reason as the topic of this topic, but the solution with the change of the topic and the parent does not pass.

  • 2
    Try to remove the android: - YuriySPb
  • one
    AppCompat connected library, its resources are not included in the android: namespace android: - pavlofff

1 answer 1

Replace

 android:Theme.AppCompat 

On

 @style/Theme.AppCompat 

Also, do not forget to inherit your classes not from the Activity , but from AppCompatActivity , that is,

 public class Main extends AppCompatActivity