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

后端 未结 12 2001
死守一世寂寞
死守一世寂寞 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:08

    If you are using gradle as your build tool, then ensure that jar task is not disabled.

    I had multiple modules in my project, where one module was dependent on a few other modules. However, I had disabled jar task in build.gradle:

    jar { enabled = false }

    That caused it to fail to resolve classes in the dependent modules and fail with the above error.

提交回复
热议问题