我从github下载了一个项目,该项目没有为RoundedImageView提供必要的库,而该库正试图找到该库。我对Android有点陌生,并且没有使用build.gradle文件的经验,该文件根据图书馆的自述文件需要进行编辑。
有人可以逐步介绍如何导入该库吗?到目前为止,这是我所做的:
1.从here下载javadoc.jar文件
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
}
}
我还制作了一个libs文件夹,将jar文件放入其中,并将其添加到构建路径中……虽然没有任何错误可以解决。
最佳答案
mavenCentral()
。 JCenter是Maven Central的超集。 buildScript
中,使它们可用于构建脚本(因此具有名称),而不可用于您尝试构建的项目。 allprojects
闭包中(或添加到需要它的项目中)。 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
}
}
关于android - 从Maven Central导入RoundedImageView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26091887/