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
I found this blog that really fixed this issue in my case. It turns out you have to add some sort of intent:
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
It was definitely straightforward. Reference:
https://www.aboutonline.info/2018/08/error-running-app-default-activity-not-found-on-android-with-kotlin.html
The correct way to do this is to add the following to the Manifest file:
<activity
android:name="FULL_NAME_OF_YOUR_ACTIVITY"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
This should be inserted between:
<application> </application>
No need in invalidating caches.
Firstly make sure that you have included default activity in manifest.
Example:
<activity android:name=".DefaultActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
If you have tried everything and nothing seems to works then
Or check this answer
https://stackoverflow.com/a/53476487/5507705
As this question is a "landing page" for plethora of issues with manifest, resulting in no Default Activity found, here is another thing to check if you are having this problem.
Open your Manifest and switch to Merged Manifest tab.
Sometimes the issue is related to merging all the manifests in the project to one, which can result to error and therefore "Default Activity not found". The problem is this error is not shown anywhere except this Merged Manifest tab as far as I know.
Es: in a project minSdkVersion 10
, downgrade the version of implementation in build.gradle file: from 25.4.0
to 25.3.1
solve this problem.
dependencies {
implementation 'com.android.support:appcompat-v7:25.3.1'
implementation 'com.android.support:design:25.3.1'
implementation 'com.android.support:mediarouter-v7:25.3.1'
In case your application doesn't have an Activity (only a service for example), change the run/debug configuration 'Launch' option to Nothing.
Build -> Rebuild Project
File -> Invalidate Caches.. -> Invalidate and restart
It works for me. Rebuild project to make sure that no errors in project. Then we can invalidate cache.