Android Studio 3.0 cannot resolve symbol Theme

前端 未结 10 741
青春惊慌失措
青春惊慌失措 2020-12-29 20:46

As stated in style.xml, there is a weird error, which shows Cannot resolve symbol \'Theme\', which is quite strange.

See pic of the error :-

My Project Spe

相关标签:
10条回答
  • 2020-12-29 21:14

    Simplest Solution

    • Close project
    • Import/Reopen project again (Open from directory)
    0 讨论(0)
  • 2020-12-29 21:18

    Another possible reason is: Google's maven repository is not set for the build script.

    Open your project's main build.gradle add this line:

    buildscript {
        repositories {
            google()  <-- this
            // Be also sure that google() is before jcenter()
        }
    }
    

    Without this, it may not be able to download the Android Studio Gradle plugin 3.0+. It's not distributed in jCenter but in the Google's maven repository.

    0 讨论(0)
  • 2020-12-29 21:19

    It seems to be a setting update of "injected references". Search this word in settings dialog and change its "Severity" option to a different value and apply, then change back to its original choice. The error highlight in the editor then disappears.

    0 讨论(0)
  • 2020-12-29 21:19

    Delete 'com.android.support:appcompat-v7:27.0.0','com.android.support:design:27.0.0' compile from app build.gradle then sync and then again paste those 2 compile then sync.... it will solve

    0 讨论(0)
  • 2020-12-29 21:24

    In my case, Invalidate Caches/Restart worked fine for me.

    0 讨论(0)
  • 2020-12-29 21:25

    Close the project and import it again. Worked for me today.

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