thepoosh
thepoosh

Reputation: 12587

Android: Editor does not contain a main type

I'm currently working on an Android app using Eclipse on a Mac OSx. I tried integrating Gorilla-Logic monkey talk SDK into my app for testing and since I did that, the app doesn't want to debug correctly. every time I click the Run or Debug buttons, the IDE claims I don't have a main type.

from what I read in the various Internet discussions on the web and here on SO, I saw that this is caused usually when writing in Scala and having code outside a package, but since I'm not running Scala but an Android project, I don't have any java code outside a package.

so why is this happening to me?!

exporting the project as an .apk file has no problems but takes a long time and I don't want to repeat that every time I want to run a project.

any thoughts?

Upvotes: 2

Views: 1026

Answers (3)

ubzack
ubzack

Reputation: 1876

The problem was caused on my end mainly by running android projects and simple java projects in the same Eclipse workspace (which should be able to be done, but I think some unknown glitch occurred, and this is what caused this problem for me).

The way I finally fixed it was by going into Preferences -> Run/Debug, then "Launching". Under "Launch Operation", I checked "Always launch the previously launched application." And since then I only had to click the dropdown arrow next to the green play button once, and each subsequent time I ran my project, I was able to just hit the green play button.

Also, the default keystroke for running an app, as you may know, is Ctrl+F11, if you're tired of pressing that green button (at least this is the case in Windows, it may be different on other OSs).

Upvotes: 2

Steven L
Steven L

Reputation: 15354

Same problem for me. I was able to fix it by clicking the down arrow next to the run button in eclipse, and adding a run configuration. But every time I run my app I need to click the down arrow and the configuration, instead of just clicking on the run button. It's an extra step. I'm also on OS X. This works fine on my PC.

I'd call this an acceptable workaround, but not a fix.

Upvotes: 0

thepoosh
thepoosh

Reputation: 12587

Ended up deleting the Run Configurations and re-launching the app.

worked like a charm

Upvotes: 0

Related Questions