I upgraded IntelliJ Idea from 12.0.4 to 12.10.
Now all the modules in my Android project give the error:
Error: Default Activity Not Found
Nothing above helped me. After some time I found that IDEA changed action names to uppercase. Like:
<intent-filter>
<action android:name="ANDROID.INTENT.ACTION.MAIN"/>
<category android:name="ANDROID.INTENT.CATEGORY.LAUNCHER"/>
</intent-filter>
After reverting to normal, IDEA recognizes default activity:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
In my case File -> Invalidate Caches / Restart...
didn't help
Everything was ok with my project and of course I had next intent filter for my activity
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
What really helped me is deleting Android/Gradle cache folders (they can grow up to 10-30 GB)
Go to C:\Users\YOUR_USER_WINDOWS_NAME
and delete next folders
(you may save some Android configs from .AndroidStudio3.2
before deleting it if you want it)
You can create bat file CLEAR_CACHE.cmd
like this to delete folders without Recycle Bin
rmdir /S /Q .android
rmdir /S /Q .AndroidStudio3.2
rmdir /S /Q .gradle
it would work much faster and you don't have to delete it also from Recycle Bin
p.s. put CLEAR_CACHE.cmd
into C:\Users\YOUR_USER_WINDOWS_NAME
it's also a good idea to delete Android Studio folder and download it again
I changed my Intent-filter to
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Just add DEFAULT option as well. I was using the Process Phoenix library and it prompted me to define a default intent. This addition solved my problem.
This occurred to me after my PC restarted unexpectedly.
Strangely, I had made no changes and still got this error.
None of the above helped me. What solved my problem, is this.
Step 1:
Step 2:
Step 3:
If this doesn't solve the problem give other tries.
Try 1:
File -> Invalidate Caches / Restart...
Try 2:
check whether these following two lines
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
are in your launcher activity declaration in manifest.xml
<activity
android:name="com.your.package.name.YourActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Try 3:
if this also doesn't help.
Try 4:
Best luck.
100% working
You must be seeing this
First open your manifest and check if this present,
<activity
android:name="com.your.package.name.YourActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
If not present add it
If the above is present but still you see default activity not found.
Follow these steps:
1. Click edit configuration
2. On clicking edit configuration you'll see that launch option is set on DEFAULT ACTIVITY
Problem solved!
Happy Coding.
@TouchBoarder almost had it. Although selecting "Do not launch Activity" results in nothing launching.
In Android Studio under Run/Debug Configuration -> Android Application -> General -> Activity -> select the option "Launch:"
Choose your Activity. This doesn't exactly fix the intended behaviour but rather overrides it correctly.