如何使用AIDE库 [英] How to use libraries in AIDE

查看:1181
本文介绍了如何使用AIDE库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不是很熟悉的摇篮,但是从我了解你应该能够从互联网上直接拉库?我已经按照该项目的方向,却得到了一个错误

难道AIDE不支持远程Maven回购?我证实,有关该库的jcenter网站的存在。我不知道如何使本地仓库。我试图从jcenter下载相关文件,并把它们... / Maven的回购/ COM / melnykov / floatingactionbutton / 1.0.3和点助手... / Maven的回购中的设置,但没有采取任何行动。

解决方案
  

注:AIDE现在支持远程Maven仓库的,所以这个答案是过时的,除非您使用的是旧版本。

AIDE不支持远程Maven回购。你可以让Maven仓库应用程序中工作的唯一方法是创建一个本地Maven回购。这很简单,只要从PC上的文件夹复制到设备,如果你需要的库是在 / SDK路径/演员/ (Android和谷歌库在那里),但位更困难,如果它不是

我不得不使用这些步骤成功手动创建Maven仓库:

  1. 在下载上 jcenter.bintray.com 从右侧子目录中的下列文件:
    • 的maven-metadata.xml的
    • 神器名-version.aar
    • 神器名-version.pom
  2. 您的设备上创建一个新的文件夹并将其命名为 m2repository
  3. 开启的maven-metadata.xml的并记住的的groupId 的artifactId 版本
  4. 为每个组件创建的文件夹中的的groupId 的你的 m2repository 的内部(如的groupId = com.github.test,文件夹结构:COM / github上/测试)
  5. 里面的文件夹结构(如文件夹中的测试的),创建一个命名的文件夹中的的artifactId 的距离的的maven-metadata.xml的的(通常它的
  6. 将下载的的maven-metadata.xml的的到新创建的的artifactId 的文件夹
  7. 创建的元数据文件的版本命名的新文件夹(如 1.0.0
  8. 将在聚甲醛和AAR文件到新创建的文件夹中。

现在,你必须用AIDE链接maven的目录:

  • 开启AIDE
  • 转到菜单​​>更多>设置>生成和运行
  • 点击本地Maven资源库
  • 添加路径到m2repository文件夹(因此与路径结束 / m2repository
  • 关闭设置
  • 等到AIDE重建项目

如果你有一个code-只有库(没有资源),机会是有,你可以很容易地直接复制到一个.jar文件的库/ 项目的文件夹中。在这种情况下,请确保您有以下行添加到您的build.gradle的依赖部分:

 编译文件树(导演:库,包括:['的* .jar'])
 

请注意,这一切只适用于你的项目使用新的摇篮为基础的项目结构。

I'm not very familiar with Gradle, but from what I understand you're supposed to be able to pull libraries straight from the internet? I've followed the project's directions, but got an error

Does AIDE not support remote maven repos? I confirmed that the library in question does exist on the jcenter website. I'm not sure how to make a local maven repository. I tried to download the relevant files from jcenter and put them in .../maven-repo/com/melnykov/floatingactionbutton/1.0.3 and point AIDE to .../maven-repo in the settings, but that did nothing.

解决方案

Note: AIDE now supports remote maven repositories, so this answer is obsolete unless you are using an older version.

AIDE does not support remote maven repos. The only way you can make maven repositories work within the app is create a local maven repo. This is as simple as copying a folder from PC to Device if the library you need is in /sdk-path/extras/ (Android and Google libs are there), but a bit more difficult if it is not:

I had success manually creating a maven repository using these steps:

  1. Download the following files from the right subdir on jcenter.bintray.com:
    • maven-metadata.xml
    • artifact-name-version.aar
    • artifact-name-version.pom
  2. Create a new folder on your device and call it m2repository
  3. Open maven-metadata.xml and remember the groupId, artifactId and version
  4. Create folders for every component of the groupId inside your m2repository (e.g. groupId = com.github.test, folder structure: com/github/test)
  5. Inside of the folder structure (e.g. folder test) , create a folder named after the artifactId from the maven-metadata.xml (often it's library)
  6. Move the downloaded maven-metadata.xml into the newly created artifactId folder
  7. Create a new folder named after the version from the metadata file (e.g. 1.0.0)
  8. Move the pom and aar files into the newly created folder.

Now, you have to link the maven directory with AIDE:

  • Open AIDE
  • Go to Menu>More>Settings>Build and Run
  • Tap Local Maven Repositories
  • Add the path to your m2repository folder (so the path ends with /m2repository)
  • Close settings
  • Wait until AIDE rebuilds the project

If you have a code-only library (no resources), chances are there is a .jar file which you could easily just copy into the libs/ folder of your project. In this case make sure you have the following line added to the dependencies section of your build.gradle:

compile fileTree(dir: 'libs', include: ['*.jar'])

Please note all this only applies if your project uses the new gradle-based project structure.

这篇关于如何使用AIDE库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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