3

I previously had a working android project when I was using IntelliJ IDEA 14. I could run the project by pressing the play button, and it would install and start the application on my device.

I recently updated to 14.1. The code still appears to compile fine, I can see that it generates an APK and I can view it in the output folder (out/production/myapp/myapp.apk), but now I get an error when I attempt to run the project:

Error:No main class for module: app

I've tried creating two new projects, one based on the Android->Application Module template and another based on the Android->Gradle: Application Module template, and both have the same issue - they spit out the error above with the default configuration.

I assume that this must work on other users boxes, particularly because I haven't found anything online or any bug reports about it, but I guess there is a very minute possibility that I'm the first one to find this.

Is this an issue with IntelliJ IDEA 14.1 or just my box? Any ideas on how to fix it or where to start would be greatly appreciated.

VendettaDroid
3,1092 gold badges31 silver badges43 bronze badges
asked Mar 27, 2015 at 23:02
5
  • If you created it new with "Android->Gradle: Application Module" then it should work out of the box using the same gradle based setup that Android Studio uses. Be sure you are creating it cleanly. Check the run configuration (Run->Edit Configurations) and make sure the project is setup to be an Android project rather than just an "Application" as the latter will require a main class. Commented Apr 7, 2015 at 2:05
  • Yeah, I've tried letting IntelliJ create an empty Gradle project and it still generated the same error. It looks like this may be a broader issue, as I'm also developing a Play Framework application in Scala and just ran into the same error. I'm fairly certain it's something specific to my setup, but I haven't been able to track down the issue yet. Commented Apr 7, 2015 at 6:20
  • 1
    Do you have haxe plugin installed? Try to uninstall and try after that. Commented Apr 8, 2015 at 1:15
  • @VendettaDroid - Wow, that was it! I uninstalled the Haxe plugin and now it starts right up. Strange that it just started happening recently, I've had it installed for a while. Can you post your comment as an answer so I can mark it resolved? Commented Apr 8, 2015 at 4:15
  • Sure, added as an answer. Glad that helped out, i was having similar issue. Commented Apr 9, 2015 at 18:18

1 Answer 1

3

I was having similar issue.

Do you have haxe plugin installed? Try to uninstall and try after that and it should work.

answered Apr 9, 2015 at 18:19
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks again for your help, not sure I would have figured that out otherwise! I had just submitted to using SBT and the command line instead, haha.
I think haxe plugin guys are aware of it and may fix it.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.