Unable to import material library into android studio

I read this page in which " import libraries into Android studio ". but it does not work for me. I am doing these steps for Material Library> . . in Material Design build.gradle file have:

https://github.com/navasmdc/MaterialDesignLibrary/blob/master/MaterialDesign/build.gradle

when I click " Sync Project with Gradle Files ", it gives me two errors:

  • Error:(2, 0) Plugin with id 'com.github.dcendents.android-maven' not found.
  • Error:(3, 0) Plugin with id 'com.jfrog.bintray' not found.

Can someone tell me how to solve this error?

note : I am reading this one but not understanding.

+5
source share
4 answers

Do not follow the above guide, the approach shown is useful when the library is not published as a dependency on maven or gradle. But as the Github page reports, it is published on maven.

So, completely remove the module or library project from the project and use the gradle dependency instead.

Just copy this to your app build.gradle module inside dependency closure

 dependencies { // YOUR OTHER DEPENDENCIES compile 'com.github.navasmdc:MaterialDesign: 1.+@aar ' } 

Sync your project with gradle.

+6
source

If you want to download the material library and import it without using the gradle pyus13 method, you need to add the following lines to the MaterialDesign Build.gradle file:

 buildscript { repositories { mavenCentral() jcenter() } dependencies { classpath 'com.github.dcendents:android-maven-plugin:1.2' classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0' } } 

To find this file, you can double-click on the error that occurs during synchronization, which looks like this:

 Error:(2, 0) Plugin with id 'com.github.dcendents.android-maven' not found. 

I also had to add compile project(':MaterialDesign') to the build.gradle file of the application.

+6
source

This was kindly answered by @ pyus13, but I would like to give a complete answer with the source github.com/navasmdc/MaterialDesignLibrary#howtouse :

You can use the gradle dependency, you have to add these lines to your build.gradle file:

 repositories { jcenter() } dependencies { compile 'com.github.navasmdc:MaterialDesign: 1.+@aar ' } 

build.gradle you are looking for is located in ProjectName\app\src .

0
source

Add two dependencies in Project build.gradle

 dependencies { classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3' } 
0
source

Source: https://habr.com/ru/post/1212121/


All Articles