多个模块项目中的每个 AndroidManifest 都可以有自己的 <application> 部分吗?如何在模块之间共享资源?

can each AndroidManifest in multiple modules project have it's own <application> part? how to share resource among the modules?

拥有一个包含多个模块的 androidStudio 项目。

prj - 应用插件:'com.android.application', (prj 也是同时使用 modulA 和 moduleB 的测试应用程序)

内部模块 A 依赖于模块 B。

并且这些模块将用作其他不同应用程序项目中的库。另一个应用程序项目可能依赖于模块 A 或模块 B。

在模块 A 中有一些活动,

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.oath.module_a">

<application
    android:hardwareAccelerated="true"
    android:largeHeap="true">

    <activity
        android:name="com.module_a.LoginActivity"
        android:launchMode="singleTop"
        android:theme="@style/ModuleATheme" />

   ... ...

</application>

在模块 B 中也有一些活动。

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.oath.module_b">

<application
    android:hardwareAccelerated="true"
    android:largeHeap="true">

    <activity
        android:name="com.module_b.DetailsActivity"
        android:launchMode="singleTop"
        android:theme="@style/ModuleBTheme" />

   ... ...

</application>

如果模块相互依赖,可以在模块的单独清单中包含 吗?

如果在模块A和模块B中都使用共享资源,如何制作?

is it ok to have in the individual manifest of the module if the module has dependency on each other?

是的。编译应用程序时,来自模块(以及您的库、应用程序和构建变体)的清单全部合并在一起。

How to make the shared resources if they are used in both moduleA and moduleB?

由于moduleA依赖于moduleB,你应该可以把共享资源放在moduleB中,moduleA应该可以引用。