3

我的问题可能很简单,但我找不到答案:对于我的 android 项目,我尝试实现https://github.com/iPaulPro/aFileChooser 在安装说明中我们找到:

Add aFileChooser to your project as an Android Library Project.

带有指向http://developer.android.com/tools/projects/projects-eclipse.html#ReferencingLibraryProject的链接当我按照链接点 1 进行操作时:

 1. Make sure that both the project library and the application project 
 that depends on it are in your workspace. 
 If one of the projects is missing, import it into your workspace.

我应该怎么做这点?将 aFileChooser 压缩到主文件夹中,还是我需要右键单击应用程序并创建新包之类的?

注意:我正在使用 android studio 并按照评论中的教程进行操作,但 android studio 不会将该项目识别为库。我通过下载 zip 从 github 获得了项目。

4

2 回答 2

3

1 - 在项目的“主”根目录(res、java 和 AndroidManifest.xml 文件所在的位置)创建一个新文件夹:

/库

2-将您的库粘贴到新创建的

/库

文件夹。现在只需从 Github 下载 ZIP,将库目录重命名为“aFileChooser”并复制它。

3 - 在 app/build.gradle 添加您的库项目作为依赖项:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile project(":aFileChooser")
}
于 2015-06-04T10:18:34.997 回答
-1

To resolve this problem:

  • Download and unzip the library
  • In your project go to file-> new -> import module -> click on the small button at the right and choose the library that you are downloaded ->ok NOTE: INTO 'aFileChooser-master' THERE ARE 2 FOLDERS: aFileChooser AND aFileChooserExample. YOU SHOULD SELECT aFileChooser
  • Now go to file -> project structure -> select the tab 'app' at the left ->select the tab 'dependencies' -> click on the plus button -> choose module dependencies -> select the library ->ok
  • Finish. Now you can use the classes of the library in your project.
于 2017-11-11T13:40:49.487 回答