如何进口材料设计库到Android工作室 [英] How To Import Material Design Library To Android Studio

查看:123
本文介绍了如何进口材料设计库到Android工作室的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要导入此lib添加到我的机器人工作室V1.0.0 RC2项目:

i want to import this lib to my project in android studio v1.0.0 rc2:

<一个href="https://github.com/navasmdc/MaterialDesignLibrary">https://github.com/navasmdc/MaterialDesignLibrary

,但有一个问题。当我加入这个LIB的模块出现此错误:

but there is a problem. when i add this lib as module this error appears:

Error:Dependency MyApplication.libraries:MaterialDesign:unspecified on project app resolves to an APK archive which is not supported as a compilation dependency. File: C:\ADTBundle\StudioWorkspace\MyApplication\libraries\MaterialDesign\build\outputs\apk\MaterialDesign-release-unsigned.apk

有人可以帮助我一步一步的指导?或者任何人都可以做一个摇篮依赖这个LIB?

can someone help me with a step by step guide? or can anyone make a gradle dependency for this lib?

推荐答案

如果您使用的是Android的工作室:

If you are using Android Studio:

  • 您可以导入该项目作为一个模块并更改导入的模块的 build.gradle 文件下面。

更​​改应用插件: com.android.application 应用插件: com.android.library 删除的applicationID ,并设置的minSdkVersion 到项目的minSdkVersion匹配。

Change apply plugin: com.android.application to apply plugin: com.android.library remove applicationId and set minSdkVersion to match your project minSdkVersion.

而在你的项目中 build.gradle 文件编制项目(:MaterialDesignLibrary')MaterialDesignLibrary是你的库项目的名称,也可以通过导入模块文件 - >项目结构 - >选择模块在项目 - >相关性 - >点击+添加一个模块

And in your project build.gradle file compile project(':MaterialDesignLibrary') MaterialDesignLibrary is the name of your library project or you can import the module by File -> Project Structure -> Select your project under Modules -> Dependencies -> Click on + to add a module.

这篇关于如何进口材料设计库到Android工作室的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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