Why does Android Studio highlight “Theme” red in styles.xml?

后端 未结 5 866
臣服心动
臣服心动 2021-01-13 02:55

Red highlight means Cannot resolve symbol \'Theme\'

\"enter

<

相关标签:
5条回答
  • 2021-01-13 03:27

    I had added appcompatv7 project as a module but I have forgotten to show it to my application module. Just I have realized and fixed. Now it doesn't alert me anymore. Thanks for your reply, tritop.

    0 讨论(0)
  • 2021-01-13 03:33

    It's very weird but I had the dependency in my .gradle.

    To solve the issue I deleted it(//commented), sync, get all error because of it, put the dependency again, sync again. Then the problem was gone!

    0 讨论(0)
  • 2021-01-13 03:39

    Only this worked for me!

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

    Error should be resolved now.

    If that did not resolve, then try below

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

    Issue must be resolved!

    0 讨论(0)
  • 2021-01-13 03:39

    Just delete the dependencies below and sync. Paste them again and sync.

    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support:appcompat-v7:28.0.0'
    
    0 讨论(0)
  • 2021-01-13 03:49

    This is how I solved it:

    1. Go to your project directory (or to Project View)
    2. Go into the .idea directory
    3. Remove caches and libraries directories
    4. File -> Invalidate Caches / Restart

    Should be OK now.

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