Android Studio “cannot resolve symbol” but project compiles and works

后端 未结 13 2167
我在风中等你
我在风中等你 2020-12-24 10:49

The project compiles fine. However, Android studio 3.0.1 shows reference to one particular library in red and displays \"cannot resolve symbol\". Even single stepping into

13条回答
  •  醉梦人生
    2020-12-24 11:37

    I Tried the following in order to resolve the issue:

    1. Invalidated Caches/Restart
    2. deleting .idea, .gredle under project and build under app
    3. done clean project and rebuild project
    4. deleted the caches in the installed path Eg. {installed path}.AndroidStudio4.0\system\caches
    5. upgraded the studio to latest version [I have installed as suggested by windows, so its installed same path. I might have tried new path.]

    Non of these tries helped to resolved this issue. Finaly I have tried these two steps:

    1. commented dataBinding.enabled true from build.gredle of your app as its obsolete and replaced with buildFeatures{dataBinding true}.

    2. Deleted the content of the log, tmp and caches folder from the installed path manually. Eg. {installed path}.AndroidStudio4.0\system\caches, {installed path}.AndroidStudio4.0\system\log, {installed path}.AndroidStudio4.0\system\log

    3. Restarted the android studio

    Now all reference for the Binding and other classes were restored.

提交回复
热议问题