Error:Plugin with id 'com.github.dcendents.android-maven' not found.解決辦法

導入第三方庫的時候出現問題

Error:Plugin with id 'com.github.dcendents.android-maven' not found.

這是原因為該項目的原作者會把項目發布到maven中央倉庫中,所以在gradle中添加了相關的maven發布任務。
咱們又不能連到maven的倉庫.

解決辦法:

將第三方項目中的apply plugin: 'com.android.library'保留,android{},dependencies{}中的內容保留,其余的直接刪除即可.例如我導入的highlight項目:

apply plugin: 'com.android.library'

android {
    compileSdkVersion 24
    buildToolsVersion '26.0.2'

    defaultConfig {
        minSdkVersion 10
        targetSdkVersion 24
        versionCode 15
        versionName "1.8.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }

        signingConfigs{
            debug{
                storeFile file('debug.keystore')
                storePassword "android"
                keyAlias "androiddebugkey"
                keyPassword "android"
            }
        }
    }
}


//ext {
//    bintrayRepo = 'maven'
//    bintrayName = 'Highlight'
//    publishedGroupId = 'com.isanwenyu.highlight'
//    libraryName = 'Highlight'
//    artifact = 'highlight'
//    libraryDescription = 'One for Android app highlights the directivity function of library'
//    siteUrl = 'https://github.com/isanwenyu/Highlight'
//    gitUrl = 'https://github.com/isanwenyu/Highlight.git'
//    libraryVersion = '1.8.0'
//    developerId = 'isanwenyu'
//    developerName = 'isanwenyu'
//    developerEmail = 'isanwenyu@163.com'
//    licenseName = 'The Apache Software License, Version 2.0'
//    licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
//    allLicenses = ["Apache-2.0"]
//}
//
//apply from: 'https://raw.githubusercontent.com/isanwenyu/BintrayUploadGradle/master/bintray_upload.gradle'

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:support-core-ui:24.2.0'
}
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容