简体   繁体   中英

How to import Material Design on Android Studio project

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 ?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM