AndroidStudio - 模块依赖于摇篮 [英] 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).
下面是我的应用程序树:
Here is my application tree:
- 应用
- slidingmenu(源文件)
- slidingmenu-地图支持(源文件)
下面是一个链接要明白我的意思。
Here is a link to see what I mean.
这是我得到的错误。
摇篮:一个问题发生配置项目:应用程序。
Gradle: A problem occurred configuring project ':Application'.
未能通知项目评估倾听者。
Failed to notify project evaluation listener.
名为'默认'未找到配置。
Configuration with name 'default' not found.
如何指定一个模块的依赖,并在那里做我把模块(应用程序内或内部ApplicationProject?
How do I specify a module dependency and where do I put the modules (inside Application or inside ApplicationProject?
谢谢!
编辑1:
的没关系!我回到日食! Android的工作室只是没有准备好一个真实的项目开发。的
推荐答案
您应该把您的库模块的应用项目中。为了指定一个模块依赖,简单地说:
You should put your library modules inside the Application Project. In order to specify a module dependency, simply:
- 右键点击应用的 - > 打开模块设置的
- 点击+图标
- 选择的根目录库中的模块,你想添加。
- 按照提示
- Right click on Application->Open Module Settings
- Click on the '+' icon
- Select the root directory for your library module you'd like to add.
- Follow the prompts
然后,这个模块将在你的项目中出现。然后,你需要将它添加到的应用程序的作为库的依赖。再次,在你的模块设置的:
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:
- 选择您的应用程序的模块
- 选择的依赖的右侧标签
- 单击底部的+图标
- 选择的模块依赖的
- 选择您所需的库模块
- Select your Application module
- Select the Dependencies tab on the right
- Click the '+' icon on the bottom
- Select Module Dependency
- Select your desired library module
这篇关于AndroidStudio - 模块依赖于摇篮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!