AndroidStudio - Gradle 中的模块依赖关系 [英] AndroidStudio - Module Dependencies in Gradle
问题描述
我在使用 Android Studio 中的模块依赖项编译 Android 应用程序时遇到了一个小问题.
I have a little problem compiling an android application using module dependencies in Android Studio.
因此,我希望我的应用程序使用库slidingmenu"(链接此处).
So, I want my application to use the library 'slidingmenu' (link here).
这是我的应用程序树:
- 申请
- 滑动菜单(源文件)
- slidingmenu-maps-support(源文件)
这是一个链接,可以了解我的意思.
Here is a link to see what I mean.
这是我得到的错误.
Gradle:配置项目:Application"时出现问题.
Gradle: A problem occurred configuring project ':Application'.
未能通知项目评估监听器.
Failed to notify project evaluation listener.
未找到名为default"的配置.
Configuration with name 'default' not found.
如何指定模块依赖项以及将模块放在哪里(在 Application 内或 ApplicationProject 内?
How do I specify a module dependency and where do I put the modules (inside Application or inside ApplicationProject?
谢谢!
编辑 1:没关系!我回到了日食!Android Studio 还没有为真正的项目开发做好准备.
推荐答案
您应该将您的库模块放在应用程序项目中.要指定模块依赖项,只需:
You should put your library modules inside the Application Project. In order to specify a module dependency, simply:
- 右键单击应用程序->打开模块设置
- 点击+"图标
- 为您要添加的库模块选择根目录.
- 按照提示操作
然后,此模块将显示在您的项目中.然后,您需要将其作为库依赖项添加到 Application 中.再一次,在您的模块设置中:
Then, this module will show up in your project. Then, you need to add it to Application as a library dependency. Once again, in your Module Settings:
- 选择您的应用模块
- 选择右侧的依赖项标签
- 点击底部的+"图标
- 选择模块依赖
- 选择您想要的库模块
这篇关于AndroidStudio - Gradle 中的模块依赖关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!