Remember an android app startup error Error running: Default Activity not found

The errors are shown in the figure below:

Reason 1:
This is because it is possible that When we delete the activity during the operation, Android Studio automatically removes our activity tag information from the Androidmanifest.XML, but when we create the activity again, it does not automatically fill in our activity information, so we need to fill it out manually.
Reason 1 Solution:
Fill in the Activity tag information in the Androidmanifest.xml:

<application android:allowBackup="true" android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

Reason 2:
Because of the requirement, projects do not need the Activity class. This is because When you create a project, AndroidStudio defaults to Lunche, which requires activity, so it will report an error.
Reason 2 solutions:
Step 1: Go to the Settings page

Step 2: Set it to Nothing in launch.

Read More: