Android Studio says it could not identify the launch activity when you press Run
Could not identify launch Activity: Default Activity not foundShort answer
Android Studio launches the activity marked with a MAIN action and a LAUNCHER category in the merged manifest. If none is found, it cannot start the app. Check that the merged manifest has that intent filter, that the run configuration launch option is Default Activity, and that the activity name resolves to a real class.
Fix it fast
1Find out which cause you have
Look at the merged manifest, not only your own file. In Android Studio open AndroidManifest.xml and click the Merged Manifest tab at the bottom.
grep -rn "android.intent.category.LAUNCHER" app/src/*/AndroidManifest.xml2Match what you see, then jump to its fix
- 1
The search above prints nothing, or the Merged Manifest tab shows no launcher activityNo activity has the MAIN and LAUNCHER intent filterFix - 2
The manifest has a launcher activity but the error staysThe run configuration is set to launch nothing, or a missing activityFix - 3
The launcher filter exists, but the activity is listed with a wrong name in the Merged Manifest tabThe activity name does not match a class in your namespaceFix
- 1
What does the error look like?
Could not identify launch Activity: Default Activity not foundRun > Edit Configurations > Launch Options is set to Nothing or to a class that no longer exists
Cause 1 of 3
No activity has the MAIN and LAUNCHER intent filter
1Check
The Default Activity option launches the activity that is marked as startup in the manifest. If you moved the filter, deleted it, or put it in a build variant that is not selected, nothing is marked.
grep -rn -B4 -A4 "android.intent.action.MAIN" app/src/*/AndroidManifest.xml2Fix
Add the filter to the activity that should start the app.
<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>3Verify
Press Run again. The app starts on the device.
./gradlew installDebugConfirmed by developer.android.com
Cause 2 of 3
The run configuration is set to launch nothing, or a missing activity
1Check
In Run > Edit Configurations, look at the Launch Options. Nothing launches no activity. Specified Activity launches the class you typed, so a renamed class breaks it.
grep -n "MainActivity" app/src/main/AndroidManifest.xml2Fix
Set Launch to Default Activity, or pick the right class under Specified Activity.
Run > Edit Configurations > app > General > Launch Options
Launch: Default Activity3Verify
Press Run. Android Studio installs and starts the app.
adb shell am start -W -n com.example.app/.MainActivityConfirmed by developer.android.com
Cause 3 of 3
The activity name does not match a class in your namespace
1Check
A name that starts with a period is added to the namespace from build.gradle. Anything else is read as a full class name.
grep -n "namespace" app/build.gradle*2Fix
Correct android:name so the namespace plus the name, or the full name, is the real class.
<activity android:name=".MainActivity" ... />
<!-- or the full name -->
<activity android:name="com.example.app.MainActivity" ... />3Verify
Sync and run again.
./gradlew assembleDebugConfirmed by developer.android.com
How do I stop it coming back?
- Open the Merged Manifest tab after you add libraries or build variants, so a missing launcher shows up before the first run.
- Keep one launcher activity per app module.
- Keep Launch Options on Default Activity unless you really need a specific screen.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
- QistLockA NestJS and React SaaS driving an Android Device Owner agent that locks financed phones when payments lapse.
- Nuclear Home VideoA video-streaming Android app built from scratch, engineered for smooth playback.
- Dispatch ProA real-time logistics platform: Flutter apps, Spring Boot services and a Kafka event pipeline on AWS.
Related fixes
Mobile apps
AGP 9 marks the android block as deprecated or fails on BaseExtension
java.lang.ClassCastException: class com.android.build.gradle.internal.dsl.ApplicationExtensionImpl$AgpDecorated_Decorated cannot be cast to class com.android.build.gradle.BaseExtension
AGP 9.0 uses only the new public DSL interfaces.
3 causes, each with a fixMobile apps
The editor cannot find R, so every R.string and R.id turns red
Unresolved reference: R
R is a class that the build generates from your res folder, in the package named by the module's namespace.
4 causes, each with a fixMobile apps
FirebaseInstanceIdService and FirebaseInstanceId.getToken() no longer work
Deprecation warning on FirebaseInstanceId.getInstance().getToken()
Move token handling into a class that extends FirebaseMessagingService and override onNewToken, which runs when a token is first created and whenever it changes.
2 causes, each with a fixMobile apps
Java and Kotlin compile to different JVM targets in an Android module
Inconsistent JVM-target compatibility detected for tasks 'compileDebugJavaWithJavac' (1.8) and 'kaptGenerateStubsDebugKotlin' (17)
Java and Kotlin tasks in the same module are compiling for different JVM targets, for example 1.8 and 17.
2 causes, each with a fixMobile apps
Manifest.permission.POST_NOTIFICATIONS shows red or does not resolve
Cannot resolve symbol 'POST_NOTIFICATIONS'
POST_NOTIFICATIONS exists only from API level 33.
4 causes, each with a fixMobile apps
Android Studio installs the app but cannot start the activity
The Run window shows an error that the activity class does not exist
The APK installed, but the activity named in the launch request is not in it.
2 causes, each with a fix