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

前端 未结 4 1365
有刺的猬
有刺的猬 2021-01-04 01:54

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 sp

相关标签:
4条回答
  • 2021-01-04 02:15

    Did you correctly imported also your library in Android Studio?

    Check Files > Project Structures > Libraries

    Did you see your library L?

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

    0 讨论(0)
  • 2021-01-04 02:30

    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':

    enter image description here

    0 讨论(0)
  • 2021-01-04 02:37

    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.

    0 讨论(0)
提交回复
热议问题