"Default Activity Not Found" on Android Studio upgrade

AndroidIntellij IdeaAndroid Studio

Android Problem Overview


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 reverted back to 12.0.4 and it everything works again.

Any ideas? I think it might be an issue with a missing plugin. Since the plugin is not installed, it is not able to find the default activity. Another thing could have been a local configuration, but I doubt it. I deleted the configuration folder to verify and that didn't change anything.

Android Solutions


Solution 1 - Android

If you see that error occur after upgrading versions of IntelliJ IDEA or Android Studio, or after generating a new APK file, you may need to refresh the IDE's cache.

Menu FileInvalidate Caches and restart...

Solution 2 - Android

I can't comment on why the upgrade of IntelliJ IDEA might cause this problem because I don't use it.

However, that error: "Default Activity Not Found" seems to be telling you that you don't have an activity declared in file AndroidManifest.xml that is marked as the main activity, to be launched when the application starts.

You should have at least one activity that looks something like this:

<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 you don't have at least one activity with an intent filter like that, you would most likely see the error message you have included here.

You should add that intent filter to the Activity that you wish to open when you start the application, and that should fix your problem.

Additional details

(Android Studio 4.1.2) if the project is created as EmptyApplication then the developer must manually create below three files to avoid the Default Activity Not Found error:

File AndroidManifest.xml

Enter image description here

File MainActivity.java

Enter image description here

File activity_main.xml

Enter image description here

Solution 3 - Android

If your app has a launch activity default, possibly this could be your mistake:

Enter image description here

Step 1: Select Edit Configurations

Enter image description here

Step 2: watch this warning: Default Activity not found

Enter image description here

Step 3: select a default activity

Enter image description here

Enter image description here

Step 3: Save your changes and finish

Enter image description here

Good Luck

Enter image description here

Solution 4 - Android

If you are working on a widget app, this solution should work for you:

  1. Go to Edit Configuration
  2. Set Launch Option to Nothing

Solution 5 - Android

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.

Solution 6 - Android

Try to right click on the project and choose Open Module Settings. Then go to the Sources tab in your module, find the src folder, right click on it and mark it as Sources (blue color).

There is no sources tab in later versions of Android Studio, but you can edit the build.gradle file instead: https://stackoverflow.com/questions/18947314/how-to-add-a-linked-source-folder-in-android-studio/22028681#22028681

Solution 7 - Android

In Android Studio 4.0, please change Launch to Nothing:

Run/Debug ConfigurationAndroid AppappGeneralLaunch Options → set Launch to Nothing.

Enter image description here

Solution 8 - Android

In Android Studio under Run/Debug Configuration -> Android Application -> General -> Activity -> select the option "Do not launch Activity".

Solution 9 - Android

Nothing in the previous answers helped me. After some time I found that IntelliJ 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 the default activity:

<intent-filter>
  <action android:name="android.intent.action.MAIN" />
  <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

Solution 10 - Android

Firstly make sure that you have the 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

  • Delete the cache from your %Home%\.gradle\caches and sync project again.

Or check this answer:

https://stackoverflow.com/questions/53249677/android-studio-shows-wrong-file-contents/53476487#53476487

Solution 11 - Android

This solution is 100% working

You must be seeing this:

Enter image description here

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

    Enter image description here

  2. On clicking edit configuration you'll see that launch option is set on DEFAULT ACTIVITY

    Enter image description here

  3. Change it to nothing.

    enter image description here

Problem solved!

Solution 12 - Android

In my case menu FileInvalidate Caches / Restart... didn't help.

Everything was OK with my project and of course I had the following 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 was deleting the Android/Gradle cache folders (they can grow up to 10-30 GB).

Go to C:\Users\YOUR_USER_WINDOWS_NAME and delete the following folders

  • .android
  • .AndroidStudio3.2
  • .gradle

(You may save some Android configurations from .AndroidStudio3.2 before deleting it if you want it.)

Solution 13 - Android

This method works for me. Click on the app icon and then choose edit configurations.

In the edit-configuration, choose the specified activity instead of the default activity. Then give the path of the activity below.

Click on app and edit configuration

Choose the specified activity and the directory

In the end, synchronise with the Gradle files.

Solution 14 - Android

Exit Android Studio.

Go to path C:\Users\YOUR_WINDOW_USER_NAME.AndroidStudio3.3\system

Remove the /caches folder and the /tmp folder.

Solution 15 - Android

As this question is a "landing page" for plethora of issues with manifests, 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.

For example: 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'

Merged Manifest

Solution 16 - Android

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, was this.

Step 1:

Enter image description here

Step 2:

Enter image description here

Step 3:

Enter image description here

If this doesn't solve the problem give other tries.

Try 1:

Menu FileInvalidate Caches / Restart...

Try 2:

Check whether the following two lines,

<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />

are in your launcher activity declaration in file 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:

  1. Click as shown:

    Enter image description here

  2. Run / Debug Configurations opens.

    Enter image description here

If this doesn't help either:

Try 4:

  1. Menu FileExport to ZIP.

and

  1. Import it as a new project.

Solution 17 - Android

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 the 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.

Solution 18 - Android

I got this error.

And found that in the manifest file in the launcher activity I did not put action and category in the intent filter.

The wrong one:

<activity
android:name=".VideoAdStarter"
android:label="@string/app_name">

    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />

</activity>

The right one:

<activity
android:name=".VideoAdStarter"
android:label="@string/app_name">

    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>

</activity>

Solution 19 - Android

TouchBoarder almost had it. Although selecting "Do not launch Activity" results in nothing launching.

In Android Studio under Run/Debug ConfigurationAndroid ApplicationGeneralActivity → select the option "Launch:"

Choose your Activity. This doesn't exactly fix the intended behaviour, but rather overrides it correctly.

Edit run/debug configurations and specify launch activity

Solution 20 - Android

All previous answers didn't help me.

Try to remove

<?xml version="1.0" encoding="utf-8"?>

in your AndroidManifest.

Then menu FileSync Project with Gradle Files.

Solution 21 - Android

In case your application doesn't have an Activity (only a service for example), change the run/debug configuration 'Launch' option to Nothing.

Solution 22 - Android

I found this in my code:

<context android:name=".MainActivity">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</context>

If you look very carefully, it should be <activity android:name=".MainActivity"> instead.

Apparently, I refactored an "activity" somewhere, and it changed names in the AndroidManifest as well.

Solution 23 - Android

In my case I refactored a member variable that was named "activity". I renamed it to "context"...

I found out that the refactor was made to the activity tags in the manifest, and I found them to be context tags instead... this is really stupid from Android Studio side!

Solution 24 - Android

  1. Menu BuildRebuild Project
  2. Menu FileInvalidate Caches...Invalidate and restart

It works for me.

Rebuild the project to make sure that there aren't any errors in the project. Then we can invalidate the cache.

Solution 25 - Android

I have the same problem in Android Studio 3.3 Canary 3.

The project from the Android Studio 3.0 stable version works firstly correctly, but then after some cleans/rebuilds, it starts showing the No Default Activity error.

I tried to reinstall this alpha version of Android Studio: error again. But then I started it in the old stabile Android, and using APK install, and this APK file works correctly.

Moreover, my project was created with Instant App (base, feature, instant, and app subdirectories). I think this Android Studio has some problems with Manifest.xml files separated into this multiple directories.

So I have changed it in settings to this:

Enter image description here

Solution 26 - Android

Sync Project With Gradle Files works sometimes.

To fix this overall issue you should:

  1. Exit Android Studio
  2. Go to folder USERAndroidStudiosystemcaches
  3. Delete that folder
  4. Start Android Studio.

It will re-index your files and that should work.

Thanks to kirtan403 from a similar question.

Solution 27 - Android

Since Android Studio 3.5 or 3.6 I started getting the Default Activity not found and I became tired of Invalidating Caches & Restart, rebuilding project, etc.

It turned out, the way I handle multi-modules and manifests was erroneous. I had the default Activity's Manifest in library module only, but it should've been in both app modules.

Assuming librarymodule appmodule1 appmodule2

  1. Remove HomeActivity from librarymodule Manifest whatsoever.

  2. Add:

    class AppModuleActivity1 : HomeActivity() to appmodule1
    class AppModuleActivity2 : HomeActivity() to appmodule2
    
  3. To appmodule1 Manifest inside application tag, I added:

    <activity
        android:name="com.app.name.AppModuleActivity1">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    
  4. Same about appmodule2 but change 2 for 1 in naming.

Solution 28 - Android

In my case, there was a typo in AndroidManifest.xml as shown below. Removing the "o" letter above the application tag solved it.

Apparently, Android Studio doesn't detect type errors in AndroidMainfest.xml

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

o
<application android:name=".AppName"
             android:allowBackup="false"
             android:icon="@drawable/ic_launcher"
             android:label="@string/app_name"
             android:theme="@android:style/Theme.Light.NoTitleBar">

Solution 29 - Android

Error: Default Activity Not Found

I solved it this way:

RunEdit ConfigurationAndroid Application → *enter the path of your default activity class in the "Launch" Edit Box.

Solution 30 - Android

I just faced this error in Android Studio 2.1.2.

I solved by adding the MAIN/LAUNCHER intent-filter to the default activity in flavour manifest, though filter already was in the default activity in the default manifest.

It even was in the merged manifest, but Android Studio couldn’t find it until I duplicated the filter in both manifests.

Solution 31 - Android

My experience:

Make sure that all your Java file has been identified. If IntelliJ IDEA does not identify your Java file, it is not able to understand what "Activity" means.

Enter image description here

Solution 32 - Android

Well, I got this error too,

> Error: Default Activity Not Found

Well, in my case it was for wear module...I don't need an Activity there so I simply do:

  1. go to edit configuration → WearLaunch OptionsLaunchNothing.
  2. Apply changes. Click OK.
  3. Remove the existing code for the default activity from your manifest file.

Note: Don't forget to Clean Project and Sync Gradle Files.

Solution 33 - Android

In the Android Manifest.xml, set the starting activity like the following:

<intent-filter>
    <action android:name="android.intent.action.MAIN" />

    <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

Solution 34 - Android

I was facing a similar issue recently. The issue was with the activitymanifest XML file.

Please check if taglines are closed properly.

Solution 35 - Android

Edit file androidmanifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.java2">

    <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=".MainActivityName">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

</manifest>

Solution 36 - Android

Nothing in the previous answers helped me and Android Studio made this problem with all my apps that were running before already - so I knew - it does not has to do with my code.

Now I solved it:

You need to reset Android Studio: Just go to C:\Users\yourusername\androidStudio3.2 (or similar) and delete this directory.

This guy shows you exactly how to do it in his video in an older version:

How can we reset Android Studio to its default settings?

Solution 37 - Android

Sometimes there is this error because of Android Studio misbehavior and because of the internal cache and project building system. Even we have set everything perfect for the default activity.

For such an issue, I found a solution and it is working for me.

Step 1. Android Studio → menu FileInvalid Cache and closed Android Studio.

Step 2. Go to path C:\Users\USER.AndroidStudio3.2\system

Step 3. Change the name with extension .back of the below folder

  Example: compiler should be *compiler.back*
  • compiler
  • compiler-server
  • conversion
  • external-build_system
  • framework
  • gradle
  • resource_folder_cache

Step 4: Start Android Studio and open your project.

Solution 38 - Android

I had this problem for two days. I tried every possible solution, but nothing worked. Finally, I found a solution.

Here is what you need to do:

  • Close Android Studio

  • Go to C:\Users\UserName.android and rename the build-cache folder to build-cache.bak

  • Go to C:\Users\UserName.AndroidStudio3.3\system and rename these folders

    • caches to caches.bak

    • compile-server to compile-server.bak

    • convert bat

    • conversion to conversion.bak

    • external_build_system to external_build_system.bak

    • frameworks to frameworks.bak

    • gradle to gradle.bak

    • resource_folder_cache to resource_folder_cache.bak

  • Open the Android Studio and open your project again.

Solution 39 - Android

This is still happening with Android Studio 4.0, so I have to delete the following folder to fix this problem:

C:\Users\my_user_name.AndroidStudio4.0\system\caches

Solution 40 - Android

Go to ManifestMerged Manifest Tab (bottom of the screen).

In the right panel, if you have any error, resolve it!

This was the solution for me (an error with tool:replace not needed).

Solution 41 - Android

How I solved this issue: I had no issue related to intent launcher declaration, and I even tried to manually declare the activity, but it still didn't work

I also cleared the cache and temporary folder, but nothing worked.

As I had several activities, it seems that one of the activities which I pulled from the repository had duplicate declarations:

Enter image description here

Solution 42 - Android

I started with a demo app and modified it. I change the java path inside source from com -> example -> foo to my own and edited the manifest; however, Android Studio (0.8.7) got very confused.

I tried everything listed above and none of it worked for me. Maybe it even made things worse?

My final solution was to edit <projectname>.iml in the .idea subdirectory by opening it up in Android Studio (aka text editor).

Before:

<content url="file://$MODULE_DIR$">
  <sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" generated="true" />
</content>

I (re)added the src directory (2nd line). After:

<content url="file://$MODULE_DIR$">
  <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
  <sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" generated="true" />
</content>

After saving it, Android Studio reloaded and started functioning as expected.

Solution 43 - Android

After updating Android Studio from 1.2.x to 1.3 I got the same problem and I tried all suggestions but nothing worked. Then I did this:

Go to Run/Debug Configurations. Select the configuration that gives the error and delete it. Create a new one with the same name and settings. After that, reconnect the USB cable and run the application.

This solved the problem for me.

Solution 44 - Android

Invalidate Caches / Restart


Just Restart


After that, your app must be run!

Solution 45 - Android

You might be missing <intent_filter> attributes. Make sure to include this activity inside the manifest file.

Solution 46 - Android

I've encountered the same issue. For some reason, Android Studio replaced all the android:name attributes in most of XML files, including the manifest, to android:subject which isn't recognized by Android Studio.

Enter image description here

As you can see in the picture above, the IDE doesn't recognize the android:subject attribute. As a result, it won't be able to read the lines which specify the MainActivty.

The solution is simply to change every android:subject to android:name and then Rebuild the project from the Build menu* → Rebuild Project. You might encounter the same issue when rebuilding the project, so do the same as above.

Solution 47 - Android

I have been having this problem in Android Studio 3.0.1, and it was caused by manifest merge failure. For some reason I had not been given any error message in the message output. I had to check the merged manifest (app → manifests → *AndroidManifest.xml, and then the 'Merged manifest' tab).

There at the bottom there was an error indicating that the newest library, that was added in the build.gradle file, had a dependency on some other library whose minSdk was higher than my app minSdk. The solution was in this message and it was to add

<uses-sdk tools:overrideLibrary="timber.log"/>

to AndroidManifest.xml. Actually this library (piwik 1.0.2) had already this overrideLibrary in its manifest.

The strange thing was that other team members didn’t experience this problem.

Solution 48 - Android

Go to build.gradle (project: xyz)

buildscript {
    repositories {
        jcenter() 
        google()
    }
allprojects {
    repositories {
        jcenter()
        google()
    }

// Just place 'google()' to the top of 'jcenter()'

buildscript {
    repositories {
        google()
        jcenter()
    }
allprojects {
    repositories {
        google()
        jcenter()
    // enter code here
    }
}

It works perfectly for me.

Solution 49 - Android

Just clean and rebuild. The problem will be gone.

Solution 50 - Android

I tried the option Invalidate cache and restart, no luck. Then I verified the manifest. It was having the main activity intent properly set.

I was having the 'Offline work' checked under Global Gradle Settings in menu FileSettingsBuild, Execution, DeploymentGradle.

I unchecked it, modified the build.gradle file (Project) to use a different Gradle version (com.android.tools.build:gradle:3.3.1) and saved it. That triggered a Gradle sync.

After synchronising, this error was gone. I was able to debug again.

Solution 51 - Android

For me, this problem occurred because of some other reason. So even though it has more than 30 answers, I still feel my solution might help someone.

My styles.xml was looking something like this:

<style name="AppTheme" parent="...">
    ....
</style>

<style name="AppTheme.NoActionBar" parent="...">
    ....
</style>

And my AndroidManifest.xml was something like this:

<application
    android:label="@string/app_name"
    android:theme="@style/AppTheme">
    ....
</application>

And for some reason, I decided to have my theme without ActionBar, so I went ahead and deleted it from my styles.xml. So here is the updated one:

<style name="AppTheme.NoActionBar" parent="...">
    ....
</style>

In addition to this, I had to update the theme in my manifest file, but I forgot that. So when I run the app, I got the error saying:

> Error: Default Activity Not Found

After a long struggle, I found the problem and modified my manifest fle accordingly:

<application
    android:label="@string/app_name"
    android:theme="@style/AppTheme.NoActionBar">
    ....
</application>

Conclusion:

If you have a wrong AndroidManifest.xml which may lead into manifest merge failed, then AS can give this error.

Solution 52 - Android

You can get Android Studio to not complain by going to the "Edit Configurations" menu (tap "Shift" three times, and type "Edit Configurations"). Then change Launch OptionsLaunch to "Nothing".

Solution 53 - Android

Use menu FileInvalidate Caches / Restart...

Then reboot the machine (PC, laptop, etc.)

Solution 54 - Android

I got the same/similar error in a different scenario, Error: Default Activity Not Found, and was not able to run the project.

I found out that my project had minSdkVersion=16. However, one of the packages required minSdkVersion >= 21. I updated the dependencies and build again. Then I was able to run the project again.

I use Android Studio 4.0.1

Solution 55 - Android

I was facing the same issue. In my case, I had declared an activity more than one time. After removing the duplicate activity, the error got resolved.

Solution 56 - Android

This problem is resolved with Android Studio 4.1

Solution 57 - Android

Well, I don't understand Android Studio sometimes...

I encountered the same problem and tried the what the answers here told, but to no avail.

And then I changed one thing: the action in my intent-filter was having the action name all in caps. I changed it to small and left only the word MAIN in caps, and it solved the problem! How absurd!

Solution 58 - Android

I got the error:

> Error: Default Activity Not Found after I copy pasted a code from an online course.

The mistake was in the first line in the MainActivity.java file.

Instead of package com.example.myname.justjava, the first line was package com.example.android.justjava.

From the code provided for learning, rectifying it got rid of the error.

Solution 59 - Android

It was ugly, but it worked for me:

I had this error message, and my problem was in a module. I just deleted the application tag completely from my module's manifest and it worked.

(Delete ic_launcher from the module library as well.)

It was:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.mymodule"
    android:versionCode="1"
    android:versionName="1.0">

    <uses-sdk
        android:minSdkVersion="16"
        android:targetSdkVersion="23"/>

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name">
        <activity
            android:name="com.example.mymodule.MainActivity"
            android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>

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

</manifest>

Now:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.mymodule"
    android:versionCode="1"
    android:versionName="1.0">

    <uses-sdk
        android:minSdkVersion="16"
        android:targetSdkVersion="23"/>

</manifest>

Solution 60 - Android

Check all the lines in your manifest.

In my case, I had this error:

android:theme="@android:style/Theme.Wallpaper.NoTitleBar.Fullscreen"

And there wasn't anything in the LogCat.

Solution 61 - Android

I got this error for trying to run an app that didn't have an activity (it was an androidTest project). So I just right clicked on the test project, and selected Run or Debug from the context menu.

Solution 62 - Android

Sometimes uninstalling the app for all users helps.

Go to the Application list in settings. Go to your app or scroll till the end of the list, and then uninstall it.

Solution 63 - Android

Check if an activity tag is present inside the application tag in the AndroidManifest.xml file.

Solution 64 - Android

<activity android:name=".MainActivity">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>

Just add this in your manifest file within <application> tags. Just replace MainActivity with your default activity and android.intent.action.youractivity will work.

Solution 65 - Android

If you already have the <intent-filter> tag, just be sure that you are closing all tags correctly.

My error was that I closed the <activity> tag just with a </> instead of </activity>.

Solution 66 - Android

TL;DR:

Make sure that you do not only check the action and category name, but the path as well. Especially if you did a refactor.

The solution for me was to closely check the AndroidManifest file. I did a refactor, and it not only updated the intent-filters, but it also updated the path of the intent filter name:

<!-- Type and value were added to the 
     path here when I did the refactor -->
<action android:name="android.intent.type.MAIN"/>
<category android:name="android.intent.value.LAUNCHER"/>

It should be:

<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>

Solution 67 - Android

If the options in the previous answer do not work, try deleting the .gradle folder.

I am using Android Studio 3.3.1. All my projects were fine, when they all suddenly stopped working saying that there was no activity. Even brand new projects were showing the same error.

After hours invalidating cache, trying to fix the Manifest file. I've noticed that it had some relationship with Android X libraries, like (androidx.core:core-ktx). In some projects, just updating the libraries fix the problem, but what actually worked was deleting the .gradle folder.

Solution 68 - Android

This solution should work for you:

  1. Go to Edit Configuration.

  2. Select Activity select nothing and apply.

Solution 69 - Android

None of the answers worked for me. The error message said:

> Unable to read Manifest from ../path/to/the/apk > > No default activity found

The error told me that somehow Android Studio is reading a previously-built APK file. Hence, I did ./gradlew clean to get rid of out folder which fixed the problem for me.

Solution 70 - Android

It happened to me after upgrading to Android Studio 4.0.

I tried to invalidate caches, to delete and create again the Android App configuration, to select a specific Launch activity, but I always got the error stating that the activity wasn't defined in the AndroidManifest.xml file, but of course it was.

What worked for me is going to the Run/Debug configuration (where you define the Launch Options), removing the "Gradle-aware Make" on Before launch at the bottom of the dialog. I successfully ran the app and then I added the "Gradle-aware Make" again and everything was working.

It does not make sense, I know. But that was what I did.

Solution 71 - Android

In my case this happened, because there's was a manifest merger error and I was trying to run the app.

Look at the specific error by running BuildMake Project.

Solution 72 - Android

Go to the manifest file. Then go merge the manifest file, see an error, and solve the manifest issue.

Clean the project and run.

Solution 73 - Android

The issue in my case was:

In my app module manifest, I had to replace another dependency module manifest tag.

I added the below code under the application tag and it worked for me:

tools:replace="android:allowBackup, android:usesCleartextTraffic"

For you it might be due to some other properties. You must override them as well.

Solution 74 - Android

While configuring a new project

The company name should end as .app. For example, it should be android.example.com.app and it should not be android.example.com.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSaad FarooqView Question on Stackoverflow
Solution 1 - AndroidSky KelseyView Answer on Stackoverflow
Solution 2 - Androidmattgmg1990View Answer on Stackoverflow
Solution 3 - AndroidDavid HackroView Answer on Stackoverflow
Solution 4 - AndroidKishankumar VasoyaView Answer on Stackoverflow
Solution 5 - AndroidIurii VasylenkoView Answer on Stackoverflow
Solution 6 - AndroidMicerView Answer on Stackoverflow
Solution 7 - AndroidTao NhuView Answer on Stackoverflow
Solution 8 - AndroidTouchBoarderView Answer on Stackoverflow
Solution 9 - AndroidyuliskovView Answer on Stackoverflow
Solution 10 - AndroidSalmanView Answer on Stackoverflow
Solution 11 - AndroidNehemiah NarzaryView Answer on Stackoverflow
Solution 12 - Androiduser924View Answer on Stackoverflow
Solution 13 - AndroidDurgaprasad NagarkatteView Answer on Stackoverflow
Solution 14 - AndroidAbhishek GargView Answer on Stackoverflow
Solution 15 - Androidbio007View Answer on Stackoverflow
Solution 16 - Androidsifr_dot_inView Answer on Stackoverflow
Solution 17 - AndroidSejwalView Answer on Stackoverflow
Solution 18 - Androidmehmoodnisar125View Answer on Stackoverflow
Solution 19 - AndroidJohnView Answer on Stackoverflow
Solution 20 - AndroidVladislaw VivaldyView Answer on Stackoverflow
Solution 21 - AndroidblackView Answer on Stackoverflow
Solution 22 - AndroidMuzView Answer on Stackoverflow
Solution 23 - AndroidAhmed Adel IsmailView Answer on Stackoverflow
Solution 24 - AndroidArtyomView Answer on Stackoverflow
Solution 25 - AndroidMichał ZiobroView Answer on Stackoverflow
Solution 26 - AndroidhomerunView Answer on Stackoverflow
Solution 27 - AndroidPrzemoView Answer on Stackoverflow
Solution 28 - AndroidKufuTView Answer on Stackoverflow
Solution 29 - AndroidLokesh TiwariView Answer on Stackoverflow
Solution 30 - AndroidmjollneerView Answer on Stackoverflow
Solution 31 - Androidjianwei-xView Answer on Stackoverflow
Solution 32 - AndroidPN10View Answer on Stackoverflow
Solution 33 - AndroidLinu SView Answer on Stackoverflow
Solution 34 - Androidragav subramanianView Answer on Stackoverflow
Solution 35 - AndroidTasdemirView Answer on Stackoverflow
Solution 36 - AndroidpipafriaView Answer on Stackoverflow
Solution 37 - AndroidAbhay BhusariView Answer on Stackoverflow
Solution 38 - AndroidRashid KalhoroView Answer on Stackoverflow
Solution 39 - AndroidShah Nizar BalochView Answer on Stackoverflow
Solution 40 - AndroidPaulandView Answer on Stackoverflow
Solution 41 - AndroidAyan BhattacharjeeView Answer on Stackoverflow
Solution 42 - AndroidTrophyGeekView Answer on Stackoverflow
Solution 43 - AndroidFriso van der MadeView Answer on Stackoverflow
Solution 44 - AndroidOrlando HerreraView Answer on Stackoverflow
Solution 45 - AndroidSuman AstaniView Answer on Stackoverflow
Solution 46 - AndroidSaif HakeemView Answer on Stackoverflow
Solution 47 - AndroidmarcinjView Answer on Stackoverflow
Solution 48 - AndroidSohail GujjarView Answer on Stackoverflow
Solution 49 - AndroidTushar MonirulView Answer on Stackoverflow
Solution 50 - AndroidsmkView Answer on Stackoverflow
Solution 51 - AndroidChandra SekharView Answer on Stackoverflow
Solution 52 - AndroidJitendra NandiyaView Answer on Stackoverflow
Solution 53 - AndroidDewsworldView Answer on Stackoverflow
Solution 54 - AndroidPuniView Answer on Stackoverflow
Solution 55 - AndroidBlack4GuyView Answer on Stackoverflow
Solution 56 - AndroidBenoit CanonneView Answer on Stackoverflow
Solution 57 - AndroidAnas Imran TasadduqView Answer on Stackoverflow
Solution 58 - AndroidMeenoharaView Answer on Stackoverflow
Solution 59 - AndroidNBAppsView Answer on Stackoverflow
Solution 60 - AndroidFrancesco TaioliView Answer on Stackoverflow
Solution 61 - Androidlive-loveView Answer on Stackoverflow
Solution 62 - Androidhemant patelView Answer on Stackoverflow
Solution 63 - AndroidHimalayanCoderView Answer on Stackoverflow
Solution 64 - AndroidAshView Answer on Stackoverflow
Solution 65 - AndroidAlberto AlegriaView Answer on Stackoverflow
Solution 66 - AndroidBlackHatSamuraiView Answer on Stackoverflow
Solution 67 - AndroidavelozoView Answer on Stackoverflow
Solution 68 - AndroidShivegeekyView Answer on Stackoverflow
Solution 69 - AndroidRobin ChanderView Answer on Stackoverflow
Solution 70 - AndroidPaolo GodinoView Answer on Stackoverflow
Solution 71 - AndroidRubin YooView Answer on Stackoverflow
Solution 72 - AndroidVibhu Vikram SinghView Answer on Stackoverflow
Solution 73 - AndroidVikash BijarniyaView Answer on Stackoverflow
Solution 74 - AndroidShivanand TView Answer on Stackoverflow