导入Android的凌空到Android工作室 [英] Import Android volley to Android Studio

查看:146
本文介绍了导入Android的凌空到Android工作室的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用谷歌的凌空库:)

I wanna use the google's volley library :)

我使用Android的工作室,我知道如何添加的.jar库。

I am using Android Studio and I know how to add .jar libraries.

但我不能与凌空文件创建的.jar库:

But I could not create a .jar library with the volley files:

<一个href="https://android.googlesource.com/platform/frameworks/volley">https://android.googlesource.com/platform/frameworks/volley

下面我所做的:(使用Windows 7的)

Here what I did: (using windows seven)

git clone https://android.googlesource.com/platform/frameworks/volley
cd volley
android.bat update project -p . --target android-19
ant.jar jar

和我得到的输出:

Java异常已经发生。

A java exception has occured.

如果有人知道我做错了什么或者是否有人知道如何添加非的.jar库也将是惊人的!

If someone knows what I did wrong OR if someone knows how add a not .jar library it will be amazing!

在此先感谢:)

推荐答案

所以,排球已经更新到Android Studio生成的风格,使得它很难建立一个罐子。但推荐的方式为Eclipse使用它作为一个库项目,这也适用于Android的工作室为好,但在机器人工作室workgin当我们这个所谓的模块。因此,这里是如何做到这一点谷歌希望我们能够做到这一点的指南。指南是基于这个漂亮的教程

So Volley has been updated to Android studio build style which makes it harder create a jar. But the recommended way for eclipse was using it as a library project and this goes for android studio as well, but when workgin in android studio we call this a module. So here is a guide to how do it the way Google wants us to do it. Guide is based on this nice tutorial.

  1. 在首先获得最新的凌空使用git(GIT克隆<一href="https://android.googlesource.com/platform/frameworks/volley">https://android.googlesource.com/platform/frameworks/volley).
  2. 在当前项目(机器人工作室)点击 [文件] - > [导入模块]
  3. 现在,选择目录,你下载的凌空抽射。
  4. 现在,Android的工作室可能会引导你完成剩下而是继续引导,以确认一切正常,正确
  5. 打开settings.gradle(找到根),并添加(或确认这是包括):

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

包括:应用程序',':凌空

现在去你的build.gradle在您的项目,并添加依赖:

Now go to your build.gradle in your project and add the dependency:

编制项目(:凌空)

这就是所有有给它,更简单,比编译一个罐子更容易,更安全不是依靠第三方瓶子或Maven上传。

Thats all there is to it, much simpler and easier than compiling a jar and safer than relying on third parties jars or maven uploads.

这篇关于导入Android的凌空到Android工作室的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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