IDE “Cannot Resolve @style/Theme.Appcompat” when using v7 compatibility support theme

后端 未结 13 602
北恋
北恋 2020-12-14 06:02

This is not really a huge issue, as my project still builds and runs correctly (using gradle), but I\'m having trouble getting Android Studio to recognize the application co

相关标签:
13条回答
  • 2020-12-14 06:21

    Adding compile 'com.android.support:appcompat-v7:21.0.0' to dependencies in gradle.build (Module: app) and rebuilding the project fixed the problem for me in Android studio 1.0.2.

    I also checked in SDK Manager and I did have the support libraries downloaded.

    0 讨论(0)
  • 2020-12-14 06:26

    Filip Cvejic's answer is useful. My android studio version is 1.3.1, has the same issue. It works after add one line "compile 'com.android.support:appcompat-v7:23.0.0'" as following:

       dependencies {
            compile "com.android.support:support-v4:23.0.0"
            compile "com.android.support:support-v13:23.0.0"
            compile "com.android.support:cardview-v7:23.0.0"
            compile 'com.android.support:appcompat-v7:23.0.0'
        }
    
    0 讨论(0)
  • 2020-12-14 06:30

    Fix was simple for me on android studio.

    Click help ---> Check for updates

    Then actually read what the prompt says and decide whether you want a bleeding edge update or a stable update.

    Once android studio restarts it should be working.

    Side Note: Everything was still red underlined for me until I rebuilt the project.

    0 讨论(0)
  • 2020-12-14 06:34

    My fix/problem was much simpler and different than most people here.

    My problem was similar in that I had an error like this:

    resource style/ThemeOverlay.AppCompat.Dark (...) not found
    

    The strange part was that I could build in debug mode, but not in release mode.

    My Android Manifest contained no errors. My issue was that I had two style.xml files in my resources folder.

    Simple Solution: Delete one of the style.xml files or merge them and you should be good. I had two styles that were almost exactly the same in my two .xml files. I could immediately build in release mode following the deletion of one of these files.

    [%]D - Time to clink the glasses and drink some beer. :D

    0 讨论(0)
  • 2020-12-14 06:37

    Problem was that my appcompact library projest has been located in different location. On importing I have to check "Copy project into workspace" thats all!

    0 讨论(0)
  • 2020-12-14 06:37

    Problem was that my appcompact library projest has been located in different location. On importing I have to check "Copy project into workspace" thats all!

    JUST go to Files click on close and then click on existing project and select your android project.... Theme issue will be resolved.

    0 讨论(0)
提交回复
热议问题