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?

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.


You may have to edit the launch configuration to tell it what Activity to run, or if it is running your default activity, ensure your Manifest is correctly stating this Activity.

Click the dropdown next to the Green Run Arrow on the top bar. And press 'Edit configurations':


Did you correctly imported also your library in Android Studio?

Check Files > Project Structures > Libraries

Did you see your library L?


Replace apply plugin: 'com.android.Library' (from module level gradle) to apply plugin: 'com.android.application'


Need Your Help

What are the big differences between TFVC (TFS Version Control) and Git for source control when using Visual Studio 2013?

git visual-studio tfs azure-devops tfvc

There are tons of questions and answers about Git versus TFVC Source Control, but no current answers cover the integration of Git into Team Foundation Server/Service that I can find.

good way to write "pointer to something" in C/C++

c++ c pointers typography

Is there a "good" way to write "pointer to something" in C/C++ ?