Could not identify launch Activity: Default Activity not found

前端 未结 9 859
一生所求
一生所求 2020-12-05 23:56

I\'m new to android and I have encounterded a problem. The console said that \"Could not identify launch activity: Default Activity not found\". I have add

         


        
相关标签:
9条回答
  • 2020-12-06 00:29

    Exit your android studio IDE. Then locate the "caches" folder in .AndroidStudio3.2 folder.

    Location

    C:\Users\YOUR_USERNAME\.AndroidStudio3.2\system\caches

    For example.

    Let's assume say YOUR_USERNAME is called Admin.

    C:\Users\Admin\.AndroidStudio3.2\system\caches

    Delete the caches folder and start your android studio IDE.

    0 讨论(0)
  • 2020-12-06 00:32

    In your manifest file there was wrong element name (Activity change to activity) declared

    <Activity       android:name="com.example.mrrobot.mycoolweather.activity.ChooseAreaActivity"
            android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </Activity>
    

    Change it to:

     <activity       android:name="com.example.mrrobot.mycoolweather.activity.ChooseAreaActivity"
            android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
    
    0 讨论(0)
  • 2020-12-06 00:35

    I have tried solutions here and other questions

    • clean & rebuild & invalidate and restart
    • make sure that activity has LAUNCHER as category
    • delete Android cache folder

    at End, activity tag was has <activity android:name="com.exmaple.todo.MainActivity" /> when i changed it to <activity android:name=".MainActivity" /> app worked.

    I hope it help you if other solution not work.

    0 讨论(0)
  • 2020-12-06 00:36

    Sometimes it is solved just restarting Android Studio


    I had the "Default Activity not found" problem a couple of times and I could solved restarting my android Studio.

    0 讨论(0)
  • 2020-12-06 00:39

    i had these issues with my project:

    • Default activity not found

    • xml intellisense was not working

    • 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:

    1. exit Android Studio

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

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

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

    0 讨论(0)
  • 2020-12-06 00:40

    My main activity was not declared in Android Manifest File. That's the reason which came that error. This error come because of a declaration problem of Android Manifest file. Please check it. :D

    0 讨论(0)
提交回复
热议问题