Mohidul Efaz
Mohidul Efaz

Reputation: 23

Error Running App Default Activity not found

Screenshot of ErrorI am randomly getting an error when running my code. It was working a few hours earlier, but when I restarted my computer I can't run the code. I never changed my AndroidManifest, so I don't see why this error would occur. I tried rebuilding the project and invalidating the caches but it still doesn't work.
AndroidManifest.xml

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

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

There is not error log all its says is "Default activity not found" Also the red MainActivity says "Unresolved class 'MainActivity' less... (Ctrl+F1) Validates resource references inside Android XML files."

Upvotes: 1

Views: 991

Answers (2)

Tom Larcher
Tom Larcher

Reputation: 951

It's a long shot, but from the information that you've provided, I can say that I've had a degree of success doing the following:

File -> Invalidate Caches / Restart

It seems that you have a couple of errors there, and a little more information would make it easier to assist you (maybe show your full AndroidManifest.xml so that we can check other aspects of the file for errors).

Upvotes: 1

Daniel B.
Daniel B.

Reputation: 2601

1. Select Edit Configurations from the drop down next to run button.

2. Under launch options > Launch select Specified activity.

3. Another field "Activity" will appear select your default activity.

4. Click OK and sync project with gradle files and it should work.

Upvotes: 0

Related Questions