Intellij IDEA can not resolve symbol with Play fra

2019-01-11 06:25发布

I am using IDEA 13 with Play 2.2.1 and was doing the examples on the play site.

public static Result index() {
   return redirect(routes.Application.tasks());
}

IDEA says "cannot resolve method redirect(?)" and red underlines routes.Application.tasks()

I have done "compile" and then "idea" from the play console.

7条回答
仙女界的扛把子
2楼-- · 2019-01-11 07:01

Well I am using "IntelliJ Idea 13" and doing "sbt" Playframework project with "Activator". After everything tried, I finally solved this issue with following steps in terminal/cmd at my existing root sbt project

  1. enter this command in terminal/cmd : sbt clean
  2. then delete these files and folders : ".idea", "all _.iml files" , "all target folders reside in project folder(this may not be necessary but I did it.)"
  3. enter this command in terminal/cmd: sbt idea
  4. now in IntelliJ : open project

Note: If you are building the Playframework project with "Play" command instead of "Activator" instead of sbt idea command you can try play idea or play "idea with-sources=yes"

Hope this will help you.

查看更多
登录 后发表回答