Android on Intellij showing error: not an activity

I just imported an android project into intellij from eclipse. I am new to intellij.

I got everything that worked and configured the launch configuration for Android. When I run it, it gives me an edit settings screen.

When I talk about triggering a default action, it tells me that it cannot find a default activity that is odd. When I immediately launch an action to run, it tells me that it is not a subclass or an alias of activity. I checked twice, and the class is definitely an activity.

When I ignore it and start it anyway, it explodes as soon as it crashes into the phone.

Can you help me understand / correct these errors, please?

+6
source share
3 answers

In the Intellij project structure dialog box, select the module where your activity is located.

Then, under the sources tab, add the root folder of your sources as sources for this module by clicking the "Mark as sources" link or button. The root folder of the sources should be highlighted in blue.

Now the module can find your sources and start activity.

+17
source

My solution was to delete and recreate the run configuration.

+1
source

In my case, none of these solutions worked. Then I started digging.

As I recall, my java files should have been placed in src / main / java / com.something.blabla. Then I realized that the directory changed to src / main / java / com / something / blabla.

So, I created a new com.something.blabla folder under ../ java / and moved my java files to this folder. I deleted the com folder and it worked perfectly.

0
source

All Articles