I have
<action android:name="android.intent.action.MAIN" />
and <category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.MAIN" />
and <category android:name="android.intent.category.LAUNCHER" />
While I'm using Eclipse to build & run single main project with multiple library projects, only 1 app will be installed.
However, if I migrate to Android Studio to build & run single main project with multiple library projects, multiple apps will be installed,
depending on how many projects (regardless main project or library projects) define <action android:name="android.intent.action.MAIN" />
and <category android:name="android.intent.category.LAUNCHER" />
I was wondering, is there any configuration I had done wrong in Android Studio, which causes multiple app to be installed, when I build & run the projects?
Currently, my only workaround is to remove those lines (<action android:name="android.intent.action.MAIN" />
and <category android:name="android.intent.category.LAUNCHER" />
) from all library projects' AndroidManifest.xml
. Is that common & correct way, to import project libraries in Android Studio? As in Eclipse, those lines don't install extra apps into my device.
This is how my Project Structure looks like
As you can see the first folder icon, looks different than rest of the folder icons. I guess that indicate, the first folder icon is main project, the others are library projects.
If there is only 1 main project, how come there can be multiple apps being installed?
In Eclipse only the AndroidManifest.xml
from main app project is used. In Android Studio (and Gradle build system) all the manifests are merged together.
The following lines inside an <activity>
element in your manifest indicate that that activity should be shown in the launcher menu. If you do not wish this, remove those lines.
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
All of this is intended behavior.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With