java – The activity must be exported or contain an intent-filter

java – The activity must be exported or contain an intent-filter

I changed the Select Run/Debug Configuration from my MainActivity to App and it started working. Select App configuration snapshot:

enter

Double check your manifest, your first activity should have tag

    <intent-filter>
        <category android_name=android.intent.category.LAUNCHER />
    </intent-filter>

inside of activity tag.

If that doesnt work, look for target build, which located in the left of run button (green-colored play button), it should be targeting app folder, not a particular activity. if it doesnt targeting app, just click it and choose app from drop down list.

Hope it helps!

java – The activity must be exported or contain an intent-filter

First check a Launch Activity is set in your manifest.xml file has:

<activity android_name=.{activityName}>
    <intent-filter>
        <action android_name=android.intent.action.MAIN />
        <category android_name=android.intent.category.LAUNCHER />
    </intent-filter>
</activity>

If this is set correctly, next check your run/debug configuration is set to App,

enter

If the App configuration is missing – you will need to add it by first selecting Edit Confurations

enter

If you do not have a App configuration you will need to create one, else select you App configuration and skip the creating steps. Also if your configuration is corrupt you may need to delete it but first backup your project. To delete a corrupt configuration, select it by expanding the Android App node and chose the - button.

enter

To create a new configuration, select the + button and select Android App

enter

If you have just created the configuration you will be presented with the following default name value of Unnamed and module will have the value <no module> then hit Apply and OK.

enter

Set this the name to App and select app as the module.

enter

Next select App as the run configuration and Run.

enter

Thats it!

Leave a Reply

Your email address will not be published.