android / input-samples

Multiple samples showing the best practices in input on Android.
Apache License 2.0
290 stars 268 forks source link

Default Activity not found #18

Open winster opened 7 years ago

winster commented 7 years ago

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

Error running app: Default Activity not found

tjohns commented 7 years ago

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.

111usman commented 6 years ago

Thanks a lot

iletai commented 6 years ago

thanks you @tjohns

neilakoh commented 6 years ago

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

aivision369 commented 5 years ago

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

hishark commented 5 years ago

@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 commented 5 years ago

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

JoinBelieve commented 5 years ago

@IDFDeveloper thank you very mach!!

moyarich commented 5 years ago

@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

davidofug commented 5 years ago

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.
ghost commented 5 years ago

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

Johnyoat commented 5 years ago

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

YimasoftLiuGuanJun commented 5 years ago

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

me too

andreirusu99 commented 5 years ago

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

PauloVilarinho commented 5 years ago

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

AjitPGaikwad commented 5 years ago

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

zoro238 commented 5 years ago

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

ankitk20 commented 5 years ago

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

hawkraph commented 5 years ago

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.

shoaibmushtaq25 commented 5 years ago

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.

benja420 commented 5 years ago

tanks this resolved my problem mexico....

Endless-explorer commented 5 years ago

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!

fatihgokcee commented 5 years ago

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

SilawatAamil commented 5 years ago

@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 👍

inrakesh commented 5 years ago

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

suniltn commented 4 years ago

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.

dn-l commented 4 years ago

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

malkhan-singh-gaur commented 3 years ago

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

aaddven commented 3 years ago

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.

mayukhpv1997 commented 2 years ago

Thanks man it works..