0

I downloaded a project from github that didn't come with the necessary library for RoundedImageView the library the project was trying to find. I'm somewhat new to Android, and haven't had any experience using the build.gradle file which according to the library's readme, needed to be edited.

Could someone give me a step by step on how to import this library? This is what I have done as of now: 1. Downloaded the javadoc.jar file from here

  1. changed my gradle file to look as such:

    buildscript{
        repositories{
            jcenter() //not sure what this is, it was already here
            mavenCentral() //added this
        }
        dependencies{
            classpath 'com.android.tools.build:gradle:0.12.+' //already here
            compile 'com.makeramen:roundedimageview:1.3.0' //added this
        }
    }
    allprojects{
        repositories{
            jcenter() //already here
            mavenCentral() // added this
       }
    }
    

I also made a libs folder, put the jar file in there and added it to the build path...nothing got rid of my errors though.

JBaruch
  • 22,610
  • 5
  • 62
  • 90
AIntel
  • 1,087
  • 5
  • 14
  • 27

1 Answers1

1
  1. You don't need to add mavenCentral(). JCenter is a superset of Maven Central.
  2. Adding dependencies to buildScript making them available to the build script (hence the name), not to the project you are trying to build.
  3. Add the dependency to allprojects closure (or to the project you need it in).
  4. Of course, you don't need to download anything manually. That's what dependency manager is for.

buildscript{ repositories{ jcenter() //not sure what this is, it was already here } dependencies{ classpath 'com.android.tools.build:gradle:0.12.+' //already here } } allprojects{ repositories{ jcenter() //already here } dependencies{ compile 'com.makeramen:roundedimageview:1.3.0' //added this } }

JBaruch
  • 22,610
  • 5
  • 62
  • 90