首页 > 解决方案 > “已配置相关功能,但未设置包 ID。” 创建新模块 Android 时

问题描述

我正在尝试创建一个新模块。这个模块的元素应该对第一个模块可见。这就是我添加的原因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.

标签: android-studioandroid-gradle-pluginandroid-module

解决方案


您创建的模块正在使用插件“com.android.application”,它应该使用“com.android.library”插件。您可以在模块的 build.gradle 文件中找到它,将其更改为使用库插件,它应该可以编译。


推荐阅读