Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Project in Android Studio won't start - Activity Class Not Specified

According to new IDE for android I decided to import projects from my old eclipse. Unfortunatelly I cannot run them because of information Error: Activity Class not specified This error can be found I user reproduce steps:

  1. From top bar menu choose Run (ALT+U)
  2. Edit configuration... (ALT+R)
  3. Choose or add Android application
  4. In General tab choose project in Module navigation list
  5. Here I do not know what to choose Launch default activity or Launch

No matter what I do, I still get at the bottom of Run/Debug Configurations windows error. How am I supposed start my android projects?

like image 497
deadfish Avatar asked May 17 '13 15:05

deadfish


People also ask

How do I clean my Android project?

Obviously, try to clean your project from android studio : “Build -> Clean Project”. This will clear your build folders. Clear the cache of Android Studio using “File -> Invalidate Caches / Restart” choose “Invalidate and restart option” and close Android Studio.

What is Flag_activity_new_task in Android?

The flags you can use to modify the default behavior are: FLAG_ACTIVITY_NEW_TASK. Start the activity in a new task. If a task is already running for the activity you are now starting, that task is brought to the foreground with its last state restored and the activity receives the new intent in onNewIntent() .

Why is Android studio not opening?

How do I fix launching Studio error? Open Start menu > computer > System Properties > Advanced System Properties. In the Advanced tab > Environment Variables, add a new system variable JAVA_HOME that points to your JDK folder, for example, C:\Program Files\Java\jdk1. 7.0_21.


1 Answers

Please check if your src folders are added into the build path. I imported my workspace from Eclipse by export to Gradle, and by default only gen folders were marked as source files. Because of that, IDE cannot compile your source files and cannot launch any activities.

  1. Open Navigator
  2. Open Module settings
  3. From Project Settings choose Modules
  4. Select src and gen folders and marked them as Source folders by right-click on them and select Source

Hope that will help.

like image 96
lookashc Avatar answered Oct 06 '22 00:10

lookashc