AndroidStudio - 模块依赖于摇篮 [英] AndroidStudio - Module Dependencies in Gradle

查看:256
本文介绍了AndroidStudio - 模块依赖于摇篮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个小问题,使用编译模块依赖Android Studio中的Andr​​oid应用程序。

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:


  1. 右键点击应用的 - > 打开模块设置

  2. 点击+图标

  3. 选择的根目录库中的模块,你想添加。

  4. 按照提示

  1. Right click on Application->Open Module Settings
  2. Click on the '+' icon
  3. Select the root directory for your library module you'd like to add.
  4. 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:


  1. 选择您的应用程序的模块

  2. 选择的依赖的右侧标签

  3. 单击底部的+图标

  4. 选择的模块依赖

  5. 选择您所需的库模块

  1. Select your Application module
  2. Select the Dependencies tab on the right
  3. Click the '+' icon on the bottom
  4. Select Module Dependency
  5. Select your desired library module

这篇关于AndroidStudio - 模块依赖于摇篮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆