80

I am writing a simple program of Android, and getting these no errors, I don't know what they are. My program is right, but showing not output. I think it is because of these two lines:

[2005-01-06 19:56:38 - my_Android] No Launcher activity found!
[2005-01-06 19:56:38 - my_Android] The launch will only sync the application package on the device!

17 Answers 17

158

Here's an example from AndroidManifest.xml. You need to specify the MAIN and LAUNCHER in the intent filter for the activity you want to start on launch

<application android:label="@string/app_name" android:icon="@drawable/icon">
    <activity android:name="ExampleActivity"
              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>
3
  • 6
    Those will always look exactly like that, they are not classes in your application, they are actions that are happening. Similarly you can have an Activity fire on other actions. for instance <action android:name="android.intent.action.VIEW"></action> <category android:name="android.intent.category.DEFAULT"></category> <category android:name="android.intent.category.BROWSABLE"></category>
    – tribe84
    Jan 26, 2011 at 4:41
  • The "basically" help Android decide what to do with the Activity. See the Intent section of the docs
    – dbryson
    Jan 26, 2011 at 4:47
  • 2
    To not forget to modify the value of this attribute android:name="ExampleActivity" to the proper activity main class.
    – Omar
    Apr 18, 2015 at 19:30
52

Multiple action tags in a single intent-filter tag will also cause the same error.

2
  • I received a downvote. Can anyone confirm if this symptom has been fixed? It always felt like a bug to me.
    – Gusdor
    Mar 31, 2016 at 13:17
  • A bit late but I can confirm this isn't fixed yet. I had added VIEW and INSERT actions in the same intent filter and the launcher won't recognize the activity. Refactoring into multiple intent filters fixed it. Mar 5, 2022 at 14:40
26

Like Gusdor said above, "Multiple action tags in a single intent-filter tag will also cause the same error." (Give him the credit! I could just kiss Gusdor for this!)
I didn't find any docs for this fact! I had added a new (USB) action and being clever, I lumped it in the same intent-filter. And it broke the launch. Like Gusdor said, one intent filter, one action! Apparently each action should go in its own intent filter.
It should look like this...

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

When I did this, WAZOO! it worked!

1
  • I was looking for this
    – Vijay
    Dec 28, 2013 at 8:24
17

Do you have an activity set up the be the launched activity when the application starts?

This is done in your Manifest.xml file, something like:

    <activity android:name=".Main" android:label="@string/app_name"
        android:screenOrientation="portrait">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
8

Check your manifest.xml. Make sure you have the category LAUNCHER there.

<activity android:name=".myActivity"
        android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />

        </intent-filter>
    </activity>
6

It means you didn't specify an Activity for Android to launch as the default when the app opens from the launcher. You have to add an Intent Filter in the Manifest for the Activity you would like to act as the default when the app is being launched.

Read http://developer.android.com/guide/topics/intents/intents-filters.html#ccases for more details.

5

I fixed the problem by adding activity block in the application tag. I created the project using wizard, I don't know why my AdroidManifest.xml file was not containing application block? I added the application block:

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <activity
        android:name=".ToDoListActivity"
        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>

And I get the desired output on the emulator.

4

As has been pointed out, this error is likely caused by a missing or incorrect intent-filter.

I would just like to add that this error also shows up if you set android:exported="false" on your launcher activity (in the manifest).

1
  • This was indeed my problem.
    – user353955
    Mar 6, 2013 at 9:02
2

I had this same problem and it turns out I had a '\' instead of a '/' in the xml tag. It still gave the same error but just due to a syntax problem.

2

If you are using the standard eclipse IDE provided by google for Android development, you can check the "Launcher Activity" check-box while creating a new Activity. Please find below:

enter image description here

2

In Eclipse when can do this:

enter image description here

But it is preferable make the corresponding changes inside the Android manifest file.

1

You missed in specifying the intent filter elements in your manifest file.Manifest file is:

<application android:label="@string/app_name" android:icon="@drawable/icon">
    <activity android:name="Your Activity Name"
              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>

Add and check this correctly. Hope this will help..

1

Manifest is case sensitive, so please compare this lines for any case mismatch especially the word MAIN in:

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

You can add launcher to activity in eclipse manifest visual editor:

Application Nodes section should look like this:

1

MAIN will decide the first activity that will used when the application will start. Launcher will add application in the application dashboard.

If you have them already and you are still getting the error message but maybe its because you might be using more than more category or action in an intent-filter. In an intent filter there can only be one such tag. To add another category, put it in another intent filter, like the following

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

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

        <!--
             TODO - Add necessary intent filter information so that this
                Activity will accept Intents with the
                action "android.intent.action.VIEW" and with an "http"
                schemed URL
        -->
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <data android:scheme="http" />
            <category android:name="android.intent.category.BROWSABLE" />
        </intent-filter>
0

just add this to your aplication tag in AndroidManifest.xml file

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

and also edit the uses-sdk tag from android:targetSdkVersion="16" to 17

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="17" />
0

You have not included Launcher intent filter in activity you want to appear first, so it does not know which activity to start when application launches, for this tell the system by including launcher filter intent in manifest.xml

Not the answer you're looking for? Browse other questions tagged or ask your own question.