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

如何解决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.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?
Java在半透明框架/面板/组件上重新绘画。
Java“ Class.forName()”和“ Class.forName()。newInstance()”之间有什么区别?
在此环境中不提供编译器。也许是在JRE而不是JDK上运行?
Java用相同的方法在一个类中实现两个接口。哪种接口方法被覆盖?
Java 什么是Runtime.getRuntime()。totalMemory()和freeMemory()?
java.library.path中的java.lang.UnsatisfiedLinkError否*****。dll
JavaFX“位置是必需的。” 即使在同一包装中
Java 导入两个具有相同名称的类。怎么处理?
Java 是否应该在HttpServletResponse.getOutputStream()/。getWriter()上调用.close()?
Java RegEx元字符(。)和普通点?