input-samples icon indicating copy to clipboard operation
input-samples copied to clipboard

Default Activity not found

Open winster opened this issue 7 years ago • 30 comments

Since there is no activity defined in the manifest, getting error in Android studio.

Error running app: Default Activity not found

winster avatar Oct 24 '16 11:10 winster

Yes, this is correct. This is an input manager, not an activity.

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

I'll probably add a generic activity containing instructions, just to avoid any confusion.

tjohns avatar Oct 27 '16 16:10 tjohns

Thanks a lot

111usman avatar Feb 22 '18 14:02 111usman

thanks you @tjohns

iletai avatar Jul 19 '18 00:07 iletai

I also got the same error; however, in my case it was straightforward since this error occurred in a fresh project and it turns out I have to add an intent inside activity tag to get rid of the error:

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

See reference:

https://www.aboutonline.info/2018/08/error-running-app-default-activity-not-found-on-android-with-kotlin.html

neilakoh avatar Aug 06 '18 12:08 neilakoh

@tjohns i agree with you that if we change that setting then app works fine but what if want to run the app without edit Edit Configuration ? I have checked this stack overflow question's answers to solve this issue in android studio 3.2 I have spend almost 5 hours and got the solution. I have copy that project and run in another system then its working fine, So just do following solution to fix this issue and it is work for me and i hope some one will get help with this. Solution :

  1. Delete the cash from your %Home%\.gradle\cash and sync project again.
  2. Also check that is there any duplicate tag in your Manifest.

aivision369 avatar Oct 11 '18 12:10 aivision369

@AndroidNinza thank you!!!! I spend one night to find solution, I'm trying your solution and it is downloading now, hope I can solve it and then go to bed:'-(

hishark avatar Oct 20 '18 16:10 hishark

@AndroidNinza done!!!!!!!! thank you!!!!!!!!! 😭 😭 😭 perfect solution

hishark avatar Oct 20 '18 17:10 hishark

@IDFDeveloper thank you very mach!!

JoinBelieve avatar Oct 27 '18 04:10 JoinBelieve

@IDFDeveloper thank you very

1. Delete the caches from your `%Home%\.gradle\caches` and sync project again.

that worked really well for me. I tried file>invalidate caches/restart and that did not work for me

moyarich avatar Nov 09 '18 05:11 moyarich

I lost over 6 hours hunting down the problem. I even redownload gradle, restarted Android studio, Invalidated cache/restart to no vail. Until a sister pointed me to this wonderful thread.

This came to my rescue.

@tjohns i agree with you that if we change that setting then app works fine but what if want to run the app without edit Edit Configuration ? I have checked this stack overflow question's answers to solve this issue in android studio 3.2 I have spend almost 5 hours and got the solution. I have copy that project and run in another system then its working fine, So just do following solution to fix this issue and it is work for me and i hope some one will get help with this. Solution :

1. Delete the cash from your `%Home%\.gradle\cash` and sync project again.

2. Also check that is there in no any duplicate tag in your Manifest.

davidofug avatar Nov 21 '18 10:11 davidofug

I was Scrathing GOOGLE for this answer and at last Found https://github.com/googlesamples/android-CommitContentSampleIME/issues/2#issuecomment-428936292

ghost avatar Nov 23 '18 07:11 ghost

I had to delete %Home%\.gradle , %Home%\AndroidStudio3.2 before i got it to work.

Johnyoat avatar Nov 24 '18 00:11 Johnyoat

I had to delete %Home%\.gradle , %Home%\AndroidStudio3.2 before i got it to work.

me too

YimasoftLiuGuanJun avatar Dec 07 '18 07:12 YimasoftLiuGuanJun

Make sure your application label and your activity label are not the same string resource when declared in the Android Manifest

andreirusu99 avatar Dec 15 '18 23:12 andreirusu99

how do i delete this %home%.gradle\cash im not finding it.

PauloVilarinho avatar Feb 05 '19 18:02 PauloVilarinho

Make sure your application label and your activity label are not the same string resource when declared in the Android Manifest

This is accepted answer in my case

AjitPGaikwad avatar Feb 07 '19 04:02 AjitPGaikwad

how do i delete this %home%.gradle\cash i am not finding it.

zoro238 avatar Feb 13 '19 11:02 zoro238

Go to your users home directory and there you will find .gradle folder

ankitk20 avatar Feb 28 '19 07:02 ankitk20

I deleted android studio cache; path: C:\Users\user.AndroidStudio3.3\system\caches (1). Close android studio (2). delete cache (3). start android studio I just noticed deleting cache also solve my XML autocompletion of attributes problem. The problem seems to be with android studio and not the gradle files of the project. None of the invalidate cache or delete iml and idea files worked for me.

hawkraph avatar Mar 10 '19 12:03 hawkraph

i had these issues with my project:

  1. Default activity not found

  2. xml intellisense was not working

  3. kotlin standard functions were not detecting All my above issues were resolved by Deleting System cache of Android Studio 3.3 at the home path, and it's working nicely for me,, Steps:

  4. exit Android Studio

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

  6. Then you have a \caches folder, delete this caches folder

  7. Now open Android Studio and load your project Worked for me.. i wasted couple of hours resolving this issue and finally it got resolved in this way.

shoaibmushtaq25 avatar Mar 18 '19 12:03 shoaibmushtaq25

tanks this resolved my problem mexico....

benja420 avatar May 09 '19 14:05 benja420

i dont think this is a good sulution,we need the luncher and we config them but it cant run ,so we should find why the problem happen!

Endless-explorer avatar Jun 05 '19 02:06 Endless-explorer

@tjohns i agree with you that if we change that setting then app works fine but what if want to run the app without edit Edit Configuration ? I have checked this stack overflow question's answers to solve this issue in android studio 3.2 I have spend almost 5 hours and got the solution. I have copy that project and run in another system then its working fine, So just do following solution to fix this issue and it is work for me and i hope some one will get help with this. Solution :

  1. Delete the cash from your %Home%\.gradle\cash and sync project again.
  2. Also check that is there any duplicate tag in your Manifest.

Thats worked. Thx dude !! Adamın dibisin..

fatihgokcee avatar Jun 21 '19 20:06 fatihgokcee

@tjohns i agree with you that if we change that setting then app works fine but what if want to run the app without edit Edit Configuration ? I have checked this stack overflow question's answers to solve this issue in android studio 3.2 I have spend almost 5 hours and got the solution. I have copy that project and run in another system then its working fine, So just do following solution to fix this issue and it is work for me and i hope some one will get help with this. Solution :

  1. Delete the cash from your %Home%\.gradle\cash and sync project again.
  2. Also check that is there any duplicate tag in your Manifest.

Thank you Soo much you save my project 👍

SilawatAamil avatar Jul 24 '19 06:07 SilawatAamil

@IDFDeveloper thank u so much !!!!! You save my day. I tried file>invalidate caches/restart and that did not work for me

inrakesh avatar Aug 16 '19 09:08 inrakesh

I had a similar issue, I was using pixel 2 real device as a test device to install App. in this device I had enabled multiple users (Guest) . I removed the guest user and everything started to work as usual.

suniltn avatar Sep 11 '19 02:09 suniltn

Check if there are any duplicated activities after the last merge. Was my issue.

dn-l avatar Nov 08 '19 09:11 dn-l

how do i delete this %home%.gradle\cash i am not finding it.

malkhan-singh-gaur avatar Aug 21 '20 13:08 malkhan-singh-gaur

Make sure your application label and your activity label are not the same string resource when declared in the Android Manifest

Thanks man , this was the thing in my case.

aaddven avatar Jan 13 '21 23:01 aaddven

Thanks man it works..

mayukhpv1997 avatar Dec 04 '21 11:12 mayukhpv1997