Running app gives 2 app icons in Android Studio

The <intent-filter> that affects creating multiple launcher icon is the following one:

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

Android Studio's manifest merger will always combine <intent-filter>s in library projects into main project's manifest. You may end up having multiple LAUNCHER intents in your synthesized manifest, thus having multiple launcher icons. To avoid this, simply remove the LAUNCHER intents from the library projects' manifest.


I got it! yes at last , i have to study gradles and stuff.

Actually I have 2 android projects inside the Project, one is a library and the other one is the main app.

I found out that when i imported those projects Android Studio (I exported the lib to gradle build from eclipse) doesn't care if that is a lib project or a main project. (Correct me if im wrong ).

so the only thing to make it work is to remove the intent-filter of that lib-android-project.

EDIT: @all solved it ! thanks to everyone, I never knew there was another AndroidManifest.xml , i thought eclipse removed it. and i thought Exporting it to gradle will remove it because it is checked as a library.

thanks for all your help.


You declare two intent filter, used only one Intent filter in the activity, on AndroidManifest.

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

If you used two or more intent filter in AndroidManifest, then you will have two app icon, So remove it & set one intent filter.

I hove this is usedful to you.