有一个库
https://github.com/Yalantis/uCrop
有 2 个模块 Sample
和 ucrop
- 所有逻辑都位于这里
问题是 - 当我将 ucrop
模块复制到我的项目时也添加了这个
dependencies {
...
implementation project(':ucrop')
....
}
还有这个
settings.gradle
include ':ucrop', ':app'
据我所知,我只需要添加这一行即可将新模块包含到项目中
然后我试图编译应用程序并得到这样的错误
Resolving this BuildableArtifact can only done during task execution.
The module 'ucrop' is an Android project without build variants, and cannot be built. Please fix the module's configuration in the build.gradle file and sync the project again.
我的项目不想包含新模块的原因是什么?
欢迎提问
谢谢
最佳答案
克隆要作为模块包含的存储库。
提供克隆存储库的路径。 现在假设我想在我的项目中包含日历模块。
1.现在进入android studio 点击File->New->Import module。
2.将这一行添加到app的build.gradle
implementation project(':calender')
3.将这一行添加到settings.gradle。
include ':calendar'
编辑:您还需要修改模块的 build.gradle 文件。在构建类型下,您需要添加此行
flavorDimensions "default"
关于android - 如何将模块包含到项目中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53931937/