2016-04-28 86 views
1

我一直在试图通过下载这个软件库https://android.googlesource.com/platform/frameworks/volley,然后按照本指南操作导入模块到我的项目的凌空库添加到我的Android项目:凌空错误导入时模块

First get latest volley with git (git clone >https://android.googlesource.com/platform/frameworks/volley). In your current project (android studio) click [File] --> [New] -->[Import >Module]. Now select the directory where you downloaded Volley to. Now Android studio might guide you to do the rest but continue guide to verify >that everything works correct Open settings.gradle (find in root) and add (or verify this is included):

include ':app', ':volley' Now go to your build.gradle in your project and add the dependency:

compile project(":volley").

的gradle时尝试在导入模块后同步项目,我收到以下错误消息:错误:无法下载layoutlib-api.jar(com.android.tools.layoutlib:layoutlib-api:24.3.1):没有可用的缓存版本用于离线模式。

回答

0

我相信你想用Volley而不是为排球库贡献力量。如果是这样的话,那么有更好的方法在你的项目中获胜。让Gradle处理它。 Gradle就像Maven一样是Build Management工具,但更好,因为它给你更多的自由和灵活性。

How to add libraries to gradle在android studio中。这个链接显示了如何将库添加到你的android项目。

由于Android Studio使用的是Gradle,因为它使用构建和管理工具的中间地点ANTMaven

为排球你可以添加 compile 'com.mcxiaoke.volley:library:1.0.19' 到您的项目的应用程序模块。这个库可以查找在Github

,或者你能做到这一点采用了android工作室的图形用户界面,点击文件 - >项目结构

enter image description here

example