0

I want to use this Material Design :

https://github.com/navasmdc/MaterialDesignLibrary

I have Imported it into my project and changed version numbers in build.gradle of it to versions of build.gradle of my app

Now there is a build error :

Error:(24, 13) Failed to resolve: com.nineoldandroids:library:2.4.+

I have searched and founded some solutions such as change 2.4.+ to 2.4.0 ! or this link, but they didn`t solve the problem

The question is :

When a project imported, what should be same in imported build.gradle versions and my app build.gradle versions ?!

My project compile in offline mode, Should I disable offline mode and let the Android Studio to download gradle files needed ?

Community
  • 1
  • 1
Mahmoud_Mehri
  • 1,643
  • 2
  • 20
  • 38
  • Why do you need this library? Are you targeting devices lower than API with Material Design already? – OneCricketeer Jul 29 '16 at 22:34
  • @cricket_007 : Thanks for your help but I think you don't read my question ! , I want to import a material design and I have mentioned it's link in my question, when I import it and want to compile there is an error in this material design build file – Mahmoud_Mehri Jul 29 '16 at 22:44
  • I did read your question and 1) you don't even need the library on the latest android because everything is already material. 2) You shouldn't touch any Gradle settings from the library, you just compile that project. 3) I don't know why you can't get nineoldandroids, but that is an old library that has been deprecated... https://github.com/JakeWharton/NineOldAndroids – OneCricketeer Jul 29 '16 at 23:40

1 Answers1

1

As the link for the library says, do the following in the build.gradle. Copy the compile statement below in the dependencies tag. Your library name was wrong.

repositories {
    jcenter()
}

dependencies {
    compile 'com.github.navasmdc:MaterialDesign:1.5@aar'
}

You will find the dependencies in the build.gradle in the app folder not in the project folder.

You need to disable offline mode. After the library is imported you can go back to offline mode.

About the cannot resolve error: nineoldandroid library is very old and now deprecated. I believe the material design library is using NineoldAndroid library. For some reason, it not able download this library. Why don't you add the nineoldandroid library first. If the material design library finds it then it may not try to download it.

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
suku
  • 10,507
  • 16
  • 75
  • 120
  • I have tried this, It does not solve the problem, first error is : "Error:Cause: failed to find target with hash string 'android-22' in: ...", after changing version numbers in gradle.build of the imported project, next error shown as I mentioned on my question – Mahmoud_Mehri Jul 29 '16 at 16:48
  • After installing android studio, u need to download some packages from SDK manager. That's why you are getting an error android-22 which is not downloaded yet. Please download the requisite file from SDK manager first – suku Jul 29 '16 at 21:33
  • There is new version installed ( 23 ) , when I change version to 23 this error solved but there is another error that I mentioned in the question – Mahmoud_Mehri Jul 29 '16 at 22:03
  • I am not using this library , the library I have Imported using it. Is there another library to compile instead of nineoldandroid ?. As I say in the question I am using Android Studio , not Eclipse – Mahmoud_Mehri Jul 29 '16 at 22:32
  • @Mahmood_M No one here said Eclipse.... The SDK Manager is completely separate from either IDE – OneCricketeer Jul 29 '16 at 22:33