Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio - add ownCloud library from GitHub

Tags:

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

like image 761
Pinco Panco Avatar asked Sep 16 '15 05:09

Pinco Panco


People also ask

Can I use GitHub Library in Android Studio?

Android Studio makes it easy to push changes to your favorite Open Source, professional, or personal projects on GitHub.


2 Answers

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.

enter image description here

2. Unzip library.

3. Start Android Studio.

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

enter image description here

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

enter image description here

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

enter image description here

7. Add Gradle dependency and Its Done!

  compile project(':androidlibrarymaster'); 
like image 192
AndiGeeky Avatar answered Sep 19 '22 15:09

AndiGeeky


Maybe try jitpack website to import this project with build.gradle file.

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

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

And this statement to your dependencies :

compile 'com.github.owncloud:android-library:oc-android-library-0.9.7' 
like image 38
Pawel Urban Avatar answered Sep 21 '22 15:09

Pawel Urban