Default Activity not found in Android Studio

后端 未结 28 1142
盖世英雄少女心
盖世英雄少女心 2020-11-29 03:22

I just upgraded to Android Studio 0.2.8 and I am getting an error that says \"Default Activity not found\" when I try to edit the run configurations.

When I launch A

相关标签:
28条回答
  • 2020-11-29 03:51

    this happened to me because I capitalized the paths in the manifest. changed:

    <intent-filter>
        <action android:name="ANDROID.INTENT.ACTION.MAIN"/>
        <category android:name="ANDROID.INTENT.CATEGORY.LAUNCHER"/>
    </intent-filter>
    

    to

    <intent-filter>
      <action android:name="android.intent.action.MAIN"/>
      <category android:name="android.intent.category.LAUNCHER"/>
    </intent-filter>
    

    and it was fixed

    0 讨论(0)
  • 2020-11-29 03:51
    1. In Android Studio

    2. Go to edit Configuration .

    3. Select the app.

    4. choose the lunch Activity path.

    5. apply, OK.

      Thanks!!

    0 讨论(0)
  • 2020-11-29 03:54

    I had the same problem while importing a project into Android Studio, probably caused by the fact that the project has been developed on an earlier version of Android Studio than currently installed on my computer.

    What solved it was simply choosing:

    File -> Invalidate Caches / Restart...

    and then selecting Invalidate and Restart.

    0 讨论(0)
  • 2020-11-29 03:54

    I ran into the same issue today and was going through the answers here.

    For me the difference was that yesterday it worked fine, so I figured it could not really be a configuration issue, neither configuration nor Version of Android Studio changed.

    Fortunately, I tried a restart of Android Studio before trying any of the other answers, and luckily that solved the issue.

    So for all people out there who run into this: first thing to try is to restart Android Studio and only if that does not solve the issue try the other answers here.

    0 讨论(0)
  • 2020-11-29 03:54

    In some case you can have model with some category field, if you will refactor it in all places, it may refactor it in manifest file and then and the tag xml will became invalid.

    0 讨论(0)
  • 2020-11-29 03:55

    Many possibilities can be happened for this kind of case (Default Activity not Found) If all code are fine, especially on Manifest, just just need to Invalidate Cache and restart the studio,

    But sometime it is happened when you have duplicate activity declaration on manifest, not only for the Main activity, it is also triggered by child activities as well.

    That happened with me, Default activity not found because i have duplication child activities on manifest, after deleted that, everything is well

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