Android Studio - 'Cannot resolve symbol' syntax highlighting errors although build is ok

后端 未结 3 1908
忘了有多久
忘了有多久 2020-12-19 09:26

I have a really annoying problem since several days, after I tried to restore a previously working Android Studio project from a backup, after getting a new computer.

3条回答
  •  别那么骄傲
    2020-12-19 10:05

    The reason is because I had a '!' symbol in my project path. Apparently, as I learnt now, many Java programs fail due to this reason! :-)

    I just renamed the path and it works fine now :-)


    P.S.

    Thank you @gabriele-mariotti for the gradlew clean suggestion. In fact, that helped me find the real root cause. I was not able to run gradlew from the terminal due to a RuntimeException:

    Could not determine wrapper version. at org.gradle.wrapper.GradleWrapperMain.wrapperVersion
    

    But that helped me learn about the effect of '!' symbol on paths, and to the root cause of the problem. Thank you all!

提交回复
热议问题