我正在尝试创建一个新模块。这个模块的元素应该对第一个module.That可见,这就是我将implementation project(":messanger")
添加到Build.gradle(:app)
的原因,但它给出了以下错误:
Dependent features configured but no package ID was set.
Execution failed for task ':app:processDebugResources'.
A failure occurred while executing
com.android.build.gradle.internal.tasks.Workers$ActionFacade
AAPT2 aapt2-4.0.0-beta01-6051327-linux Daemon #0: Unexpected error during link, attempting
to
stop daemon.
This should not happen under normal circumstances, please file an issue if it does.
发布于 2020-05-24 17:11:14
您创建的模块正在使用插件'com.android.application‘,并且它应该使用'com.android.library’插件。您可以在模块中的build.gradle文件中找到它,将其更改为使用库插件,它应该会被编译。
发布于 2020-05-30 22:41:42
我集成了目前的Reedy答案,强调必须为应用程序和模块使用两个不同的插件。
如果您转向buildSrc方法(强烈建议),则应该在以下位置声明两个不同的变量: buildSrc/src/main/java/dependencies.kt
object Plugins {
const val androidApplication = "com.android.application"
const val androidLibrary = "com.android.library"
}
并在app和mymodule build.gradle中正确使用它们
:应用程序
plugins {
id(Plugins.androidApplication)
.......
}
和
:mymodule
plugins {
id(Plugins.androidLibrary)
.........
}
发布于 2021-05-09 17:30:12
如果模块是库,而不是应用程序
在build.gradle ( for the module )
中使用以下配置
plugins {
// id 'com.android.application'
id "com.android.library"
}
android {
defaultConfig {
// applicationId "com.xxx.xx.x"
}
}
看起来是这样,这个库不需要applicationId
https://stackoverflow.com/questions/60461997
复制相似问题