java Android Studio - 从 GitHub 添加 ownCloud 库

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32600325/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-02 20:28:47  来源:igfitidea点击:

Android Studio - add ownCloud library from GitHub

javaandroid

提问by Pinco Panco

I don't understand how to add this library (https://github.com/owncloud/android-library) to my project in Android Studio.

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

回答by AndiGeeky

I have tried to import this library as a module but found error while importing: Error: Module name is not valid

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

So I tried to find a solution and here it is:

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

1. Download library from Github here.

1. 从这里从 Github 下载库。

enter image description here

在此处输入图片说明

2. Unzip library.

2.解压库。

3. Start Android Studio.

3. 启动安卓工作室。

4. Follow to File -> New -> Import Module .

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

enter image description here

在此处输入图片说明

5. Go to the path where your extracted library is located and select it.

5. 进入解压库所在的路径并选择它。

enter image description here

在此处输入图片说明

6. Uncheck other modules and add 'androidlibrarymaster'described in below picture.

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

enter image description here

在此处输入图片说明

7. Add Gradle dependency and Its Done!

7. 添加 Gradle 依赖,大功告成!

  compile project(':androidlibrarymaster');

回答by Pawel Urban

Maybe try jitpackwebsite to import this project with build.gradle file.

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

You have to add this snippet to your build.gradle file :

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

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

And this statement to your dependencies :

以及对您的依赖项的声明:

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