Cannot resolve symbol Theme, ThemeOverlay

前端 未结 7 1826
清酒与你
清酒与你 2020-12-17 09:17

I updated my android studio to latest version - 3.0.1. Since then it complains \'Cannot resolve symbol\' for Theme and ThemeOverlay in the following lines of code. App runs

相关标签:
7条回答
  • 2020-12-17 09:40

    Found Easiest Way

    • Close project (File> Close Project)
    • Import / Re-Open project again (NOT from Recent)

    The error should be gone.

    If(that_did_not_work)

    • Open build.gradle, remove appcompact-v7 dependency and sync.
    • Again add that dependency and sync.

    Error Gone!

    0 讨论(0)
  • 2020-12-17 09:42

    Something got messed up on the indexing of the Project when you updated the version.

    To fix go to the menu:

    File -> Invalidate Caches/Restart
    

    that will reopen and re-index the whole project, the error should be gone.

    0 讨论(0)
  • 2020-12-17 09:49

    In my case , I have already defined the value in styles.xml file but it still notice me the problem like this:

    But I still got an error like below:

    I solve this problem by change the value like below:

    Hope this is work for you too.Thank you!

    0 讨论(0)
  • 2020-12-17 09:50

    I had this same error so i compared it to gradle file of another project which wasn't showing error. In your build.gradle(Module:app) under dependencies, add the following line:

    implementation 'com.android.support:preference-v7:28.0.0'
    
    0 讨论(0)
  • 2020-12-17 09:52

    1)Close the project from the File menu.

    2)Open the project again as existing Android Studio project.

    This fix my problem.

    0 讨论(0)
  • 2020-12-17 09:52
    1. In the app/build.gradle remove the line responsible for the appcompat package (something like implementation 'com.android.support:appcompat-v7:27.1.1')
    2. Perform the Gradle sync. It will break and show a lot of errors
    3. Bring the original line back
    4. Perform the Gradle sync once again

    This will magically solve the problem that for no reason appeared in the 3.0.1

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