Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot resolve method 'ok(?)' with Play 2 Framework in Intellij

I have been trying to get play set up in IntelliJ for hours but I can't get it to work correctly.

I continuously get this error: http://imgur.com/MYY8fXI

I have tried create a project though the terminal with:

play new 

and then using the terminal to create the idea files with

idea with-sources=yes

I have also installed the play 2 plugin and used it to create the project, but I get the same error.

I am able to use the plugin I downloaded to successfully run the app and view it in my browser, but I keep getting the

Cannot resolve method 'ok(?)' error.

edit: I am using OSX, and have the ultimate version of Intellij.
edit 2: I have made a little progress. If I import the view directly using import views.html.index; it gets rid of the errors on the application. However, if I use import views.html.*; it results in the errors. Any ideas?

like image 348
kyle Avatar asked Nov 14 '13 02:11

kyle


2 Answers

At the time of this writing, it seems that play2 support in IntelliJ 13 Ultimate has some minor problems...

How I did solve the issues:

1) Navigate to your project director and start your play console (play.bat / play.sh should be on the PATH)

2) enter command 'compile' in your play console

3) enter command 'idea" in your play console

4a) in case your IntelliJ project was alread open, IntelliJ will detect the changes and suggest to reload the project. Confirm you want to reload

4b) in case IntelliJ was not running, open the project by File | Open... and select your project Directory.

These steps should resolve your issue.

like image 77
Pieter Degraeuwe Avatar answered Oct 18 '22 10:10

Pieter Degraeuwe


Does it help to make sure that play has compiled the templates to class files, 'run' + open in browser or 'compile'?

like image 1
johanandren Avatar answered Oct 18 '22 11:10

johanandren