Android清单合并:与其他声明无关的警告

问题描述

我检查了与该主题相关的大量类似帖子,但没有能够指出我面临的问题。

因此,基本上我有一个具有启动器活动的模块,但我不想通过覆盖主模块的启动器活动来成为主启动器。因此,我使用了节点tools:node="remove"删除它。示例:

主应用程序的清单: ...

   <activity
            android:name="path.ThatOneActivity"
            android:screenorientation="locked"
            android:theme="@style/AppCompatTheme.Translucent.NoTitleBar">
            <intent-filter>
                <action
                    android:name="android.intent.action.MAIN" />
                <category
                    android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <Meta-data
                android:name="nextActivity"
                android:value="path.ThatOtherActivity" />
        </activity>

我的模块的清单:

          <activity
            android:name="path.ThatOneActivity"
            android:screenorientation="locked"
            android:theme="@style/AppCompatTheme.Translucent.NoTitleBar"
            tools:node="merge">
            <intent-filter  tools:node="remove">
                <action
                    android:name="android.intent.action.MAIN"
                    tools:node="remove" />
                <category
                    android:name="android.intent.category.LAUNCHER"
                    tools:node="remove" />
            </intent-filter>
            <Meta-data
                android:name="nextActivity"
                android:value="path.ThatOtherActivity" />
        </activity>

因此,正如您所看到的,这实际上是在不同线程上的多个解决方案的混合,但它不起作用。 (是的,甚至不是个别的。)

然后我在构建时检查了日志,发现了一个警告: category#android.intent.category.LAUNCHER was tagged at AndroidManifest.xml: to remove other declarations but no other declaration present

这现在令人困惑,因为我不确定这意味着什么。与其他线程一样,我也确实添加xmlns:tools,但没有任何反应:

 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="my.borning.app">

更新

按照CommonsWare的注释进行更改:

<activity android:name="path.ThatOneActivity">
            <intent-filter>
                <action
                    android:name="android.intent.action.MAIN"
                    tools:node="remove" />

                <category
                    android:name="android.intent.category.LAUNCHER"
                    tools:node="remove" />
            </intent-filter>
        </activity>

,但仍收到警告: category#android.intent.category.LAUNCHER was tagged at AndroidManifest.xml: to remove other declarations but no other declaration present

我还是想出一件事: 我正在开发一个由主应用程序使用的模块(该模块也不由我管理,我的模块是一个之前出错的库。因此,这与Priority有关!我是试图覆盖的库)是将我的模块用作库的主应用程序的启动器。是否可以通过库覆盖启动器(基本上是可以提高Manifest的优先级,这听起来不太可能)?

如果您可以指导我具体的方向,将会很有帮助。让我知道是否需要更多详细信息。

提前谢谢!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...