Debugging log · Manifest
"Default Activity not found"
I hit Run and Android Studio stopped me before anything built: Default Activity not found. The code was fine — the app had a perfectly good main screen. The IDE just couldn't work out which activity to launch, because the one piece of the manifest that marks an entry point wasn't where it expected. This is a configuration problem, not a code one.
The short version: Android Studio launches the activity flagged as the launcher in the merged manifest. If no activity has the LAUNCHER intent-filter, the manifest failed to merge, or the IDE's model is stale, it can't find an entry point. Restore the launcher filter — or refresh the IDE — and it runs.
What marks the entry point
An app's launch screen is the activity whose manifest entry carries both the MAIN action and the LAUNCHER category:
<activity android:name=".MainActivity" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
That pair is what both the launcher icon and Android Studio use to decide what to start. Remove it, misspell it, or lose it in a merge, and "Default Activity not found" appears.
Cause 1 — the launcher intent-filter is missing or wrong
The most direct cause: no activity has that MAIN/LAUNCHER pair, or it was edited away. Check your manifest and confirm exactly one activity has it, spelled correctly. On newer Android, also make sure that activity is android:exported="true" — an unexported launcher is a related failure.
Cause 2 — the manifest didn't merge
Your final manifest is merged from your app plus libraries and build variants. If the merge failed, or your launcher activity lives in a variant/library that didn't contribute, the merged manifest has no entry point even though your source looks right. Open the Merged Manifest tab (bottom of the manifest editor) and look for the MAIN/LAUNCHER filter in the final output. If it's not there, the problem is the merge, not your file.
Cause 3 — a stale IDE model
Sometimes everything is correct and the IDE simply hasn't caught up — common right after a Git pull, a branch switch, or a manifest edit. Two quick refreshes clear it:
- Sync Project with Gradle Files.
- If that doesn't help, File → Invalidate Caches / Restart.
This is the "I changed nothing and it broke" version, and a sync is usually enough.
The escape hatch — set it manually
If you need to run right now (or you intentionally have no launcher activity, as in some library or test setups), tell the run configuration what to launch: Run → Edit Configurations → Launch → choose Specified Activity and pick it, instead of "Default Activity". That bypasses the auto-detection. It's a workaround, though — if a normal app can't auto-detect its launcher, the manifest is still the thing to fix.
Check the Merged Manifest before editing anything. Half the time your own manifest has the launcher filter and the merged result doesn't — which immediately tells you to look at a variant, a library, or a failed merge rather than your MainActivity.
Activity names above are examples — use your project's own.