Scala import not working - object is not a member of package, sbt preppends current package namespace in imports

后端 未结 12 2008
死守一世寂寞
死守一世寂寞 2020-12-14 14:28

I have an issue when trying to import in scala. The object Database exists under com.me.project.database but when I try to import it:



        
12条回答
  •  天命终不由人
    2020-12-14 15:02

    I had faced similar issue where IntelliJ showed error on importing one file from the same project.

    What did not resolve the issue in my case:

    1. adding _root_ in import statement
    2. sbt clean
    3. restarting machine

    What actually resolved the issue:

    1. main menu => select File => click on Invalidate Caches / Restart => pop-up dailog => click on invalidate the caches and restart.

    I was using IDEA (2019.2.2 Ultimate Edition) on macOs mojave 10.14.6

提交回复
热议问题