I don't understand how to add this library (https://github.com/owncloud/android-library) to my project in Android Studio.
Asked
Active
Viewed 2.8k times
25
-
3Did you read the installation instructions on the GitHub? Please post your attempt as well. – Maciej Lach Sep 16 '15 at 05:22
-
this library is add as a module in your android studio. and add in gridal file – Abhinav singh Sep 16 '15 at 05:32
2 Answers
28
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.
2. Unzip library.
3. Start Android Studio.
4. Follow to File -> New -> Import Module .
5. Go to the path where your extracted library is located and select it.
6. Uncheck other modules and add 'androidlibrarymaster' described in below picture.
7. Add Gradle dependency and Its Done!
compile project(':androidlibrarymaster');
-
I had also followed this way and I do not know if it's righ, for this i asked – Pinco Panco Sep 16 '15 at 08:03
-
@Pinco Panco : Obviously your app working with this module then its right.. :) – AndiGeeky Sep 16 '15 at 08:09
-
no, not resolve import com.owncloud.android.lib.common.network.OnDatatransferProgressListener; etc.. – Pinco Panco Sep 16 '15 at 08:26
-
@Pinco Panco : I am able to import OwnCloudCredentials and OnDatatransferProgressListener also..!! – AndiGeeky Sep 16 '15 at 08:32
-
-
-
-
I set credential with mClient.setCredentials,how to check if you are right? – Pinco Panco Sep 16 '15 at 08:38
-
@AndiGeeky I follow your stem but i am getting . Error:Configuration with name 'default' not found. What should i do?? – Ravikant Paudel Dec 25 '15 at 11:53
-
as of Android Studio 3.0.x the first Module Name input field is no longer available, any fix then @AndiGeeky – ralphgabb Jun 06 '18 at 08:47
12
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'

Pawel Urban
- 1,316
- 1
- 12
- 28
-
2
-
1If you not renamed your module name it should be the one in `app` folder. – Pawel Urban Sep 16 '15 at 09:02
-
1Can also add it to `allprojects` as shown here http://stackoverflow.com/questions/28779356/issue-resolving-gradle-dependency-in-android-studio/29565737#29565737 . just don't add it under `buildscript` – metrimer Sep 16 '15 at 14:13
-
-
@Jomme In releases tab. The last part of Gradle dependency definition is version. In case of this library the versions are tagged as 'oc-android-librabry-0.9.x'. – Pawel Urban Feb 20 '18 at 10:00