简体   繁体   English

Android Studio安装的重复应用

[英]Duplicated apps installed by Android Studio

I have an app X that has two activities X and F that appear in the drawer. 我有一个应用程序X ,该应用程序X中有两个活动XF I also use X as a library for another app A , that also has two activities that appear in the drawer, A and M . 我还将X用作另一个应用程序A的库,该应用程序在抽屉中也有两个活动AM

So, what I've always done in Eclipse to install them was: 因此,我在Eclipse中为安装它们所做的始终是:

  1. Clean both packages 清洁两个包装
  2. Install A . 安装A
  3. Go to Project > Properties > Android , disabling in Is Library . 转到“ Project > Properties > Android ,在“ Is Library禁用。
  4. Install X 安装X
  5. Enable again Is Library for X . 再次启用X Is Library

With this procedure, I always ended up with the 4 activities in the drawer. 通过此过程,我总是在抽屉中完成了4个活动。

Now, I'm trying to migrate to Android Studio. 现在,我正在尝试迁移到Android Studio。 I created a project and imported both apps as modules. 我创建了一个项目,并将两个应用程序都导入为模块。 Now to install them: 现在安装它们:

I repeated the above procedure, but editing the first line of the build.gradle file of X instead of (3) and (5) above. 我重复了上述过程,但是编辑了Xbuild.gradle文件的第一行,而不是上面的(3)和(5)。 Kind of a pain, but it works... except for a very strange problem: I end up with TWO A activities and TWO F activities in the drawer (yes, same names!), plus M and X , now I have 6 instead of 4. The two A activities, the M and one F belong to A , while X and F to X (as it has always been). 有点痛苦,但是它起作用了…… 除了一个非常奇怪的问题:我最后在抽屉中进行了两个A活动和两个F活动(是的,名字相同!),加上MX ,现在我有6个代替of 4.两个A活动, M和一个F属于A ,而XF属于X (一直如此)。

Even more crazy stuff: one of the A does not work properly, while the other does. 甚至更疯狂的东西:其中一个A不能正常工作,而另一个A可以正常工作。 In the app manager there is only one copy of A and another of X , as it has always been. 与往常一样,在应用程序管理器中只有A一个副本和X另一个副本。

Why is this?? 为什么是这样?? What I am doing wrong? 我做错了什么? How can A have installed two copies of itself??? A如何安装自身的两个副本??? Or maybe this is a bug of Nova launcher? 也许这是Nova启动器的错误? (rooted stock Android 4.4 here). (此处的根源为Android 4.4)。

Thanks! 谢谢!

L. L.

This can happen if you have multiple activities specified as launcher activities. 如果您将多个活动指定为启动器活动,则可能会发生这种情况。 Please run app after making sure that only one activity is specified as launcher in manifest. 确保清单中仅将一个活动指定为启动器后,请运行应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM