Cannot resolve symbol 'Theme' in styles.xml (Android Studio)

后端 未结 23 2327
半阙折子戏
半阙折子戏 2020-11-27 11:56

Since today, Android Studio can\'t find the AppCompat themes in styles.xml, but for example AppCompatActivity in code does get recognized. My Android Studio version

23条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-27 12:39

    That's because of feature called "build cache" that is enabled by default in build Android Plugin since 2.3.0. It creates files in build cache outside of project folder (in my case -- in \Users\%username%\.android\build-cache) Theese files are intended to be common between your projects.

    And then Android Studio is unable to navigate in theese files. That's all.

    If you want to disable Build Cache, add android.enableBuildCache=false to gradle.properties file. Then restart Android Studio.

    more info here: https://developer.android.com/studio/build/build-cache.html#disable_build_cache

提交回复
热议问题