2015-09-22 135 views
-1

在我的Android應用程序,我已經從GitHub https://github.com/IsseiAoki/SimpleCropView#download進口模塊。但我同步的gradle後,我得到錯誤:Android的搖籃錯誤ID找不到

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 '[email protected]' 
        } 
       } 
       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

您使用的是Android Studio嗎? – Emma

+0

是Android Studio中1.3.2 –

回答

1

這個包是jcenter回購已經上市,所以不是包括由源代碼,在您的應用的build.gradle

dependencies { 
    compile 'com.isseiaoki:simplecropview:1.0.8' 
} 

UPDATE的依賴性塊添加編譯軟件包名稱: 你依賴應該看起來像

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' 
} 
+0

我已經完成它 模塊搖籃: 依賴性{ 編譯文件樹(DIR: '庫',包括:[ '的* .jar']) 編譯「com.android.support:appcompat -v7:22.1.1' compile'c​​om.android.support:design:22.2.0' 編譯文件('libs/dropbox-android-sdk-1.6.3/dropbox-android-sdk-1.6.3.jar ') 編譯文件('libs/dropbox-android-sdk-1.6.3/json_simple-1.1.jar') compile'c​​om.isseiaoki:simplecropview:1.0.8' 編譯文件('libs/jcifs-1.3。 18.jar') compile'c​​om.isseiaoki:simplecropview:1.0.8' compile project(':simplecropview') –

+0

從您的項目中刪除SimpleCropView模塊並刪除編譯項目(':simplecropview'),並且只編譯'com.isseiaoki:simplecropview:1.0.8' – Emma

+0

也刪除所有編譯文件('libs/***。jar')因爲compile fileTree(dir:'libs',include:'['*。jar'])已經包含libs文件夾內的所有jar。 – Emma