I faced with same error after updating Kotlin. Solved with "Invalidate caches/Restart"
UPDATE Today this solution did not helped me. But the solution of this question did: Android Studio 3.1 Cannot Resolve Symbol (Themes, Widget, attr, etc.)
Both resources are defined with the Android Support Library and since these symbols cannot be resolved, it seems like you're missing to define the support dependency.
dependencies {
compile "com.android.support:appcompat-v7:$androidSupportVersion"
}
I updated my gradle version to 4.10.1 and fix and reimport repaired it. There were no libraries folder under .idea before.
If you use applicationContext
for LayoutInflater
, then replace it to normal context
. It works for me.