在我的Android应用程序中,我从GitHub https://github.com/IsseiAoki/SimpleCropView#download导入了模块。但是在同步我的gradle之后我得到了错误:
Error:(21, 0) Plugin with id 'com.github.dcendents.android-maven' not found.
添加模块built.gradle文件,如下所示。
apply plugin: 'com.android.library'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
minSdkVersion 9
targetSdkVersion 22
versionCode 9
versionName "1.0.8"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
group = 'com.isseiaoki'
version = '1.0.8'
def siteUrl = 'https://github.com/IsseiAoki/SimpleCropView'
def gitUrl = 'https://github.com/IsseiAoki/SimpleCropView.git'
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")
configurations = ['archives'] //When uploading configuration files
pkg {
repo = 'maven'
name = 'SimpleCropView'
desc = 'A simple image cropping library for Android.'
websiteUrl = siteUrl
issueTrackerUrl = 'https://github.com/IsseiAoki/SimpleCropView/issues'
vcsUrl = gitUrl
licenses = ['MIT']
labels = ['android']
publicDownloadNumbers = true
}
}
install {
repositories.mavenInstaller {
pom {
project {
packaging 'aar'
name 'SimpleCropView'
url siteUrl
licenses {
license {
name 'The MIT License (MIT)'
url 'http://opensource.org/licenses/MIT'
}
}
developers {
developer {
id 'isseiaoki'
name 'Issei Aoki'
email 'i.greenwood.dev@gmail.com'
}
}
scm {
connection 'https://github.com/IsseiAoki/SimpleCropView.git'
developerConnection 'https://github.com/IsseiAoki/SimpleCropView.git'
url siteUrl
}
}
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives javadocJar
archives sourcesJar
}
task findConventions << {
println project.getConvention()
}
答案 0 :(得分:1)
此软件包已在jcenter repo上提供,因此不要使用源代码包含,而是在应用程序build.gradle的依赖项块中添加编译软件包名称
dependencies {
compile 'com.isseiaoki:simplecropview:1.0.8'
}
<强>更新强> 您的依赖项应该看起来像
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.android.support:design:22.2.0'
compile 'com.isseiaoki:simplecropview:1.0.8'
}