Android Studio - 从 GitHub 添加 ownCloud 库

2022-09-01 18:53:57

我不明白如何将此库(https://github.com/owncloud/android-library)添加到Android Studio中的项目中。


答案 1

我尝试将此库作为模块导入,但在导入时发现错误:错误:模块名称无效

所以我试图找到一个解决方案,这里是:

1. 从 Github 下载库 请点击此处。.

enter image description here

2. 解压缩库。

3. 启动安卓工作室。

4. 按照文件 -> 新的 -> 导入模块 。

enter image description here

5. 转到提取的库所在的路径并选择它。

enter image description here

6.取消选中其他模块并添加下图中描述的“androidlibrarymaster”。

enter image description here

7. 添加 Gradle 依赖项及其完成!

  compile project(':androidlibrarymaster');

答案 2

也许尝试jitpack网站使用build.gradle文件导入此项目。

您必须将此代码段添加到 build.gradle 文件中:

repositories {
    // ...
    maven { url "https://jitpack.io" }
}

以及此语句到您的依赖项:

compile 'com.github.owncloud:android-library:oc-android-library-0.9.7'

推荐