簡體   English   中英

Android gradle錯誤:(69,0)未找到Gradle DSL方法:“ compile()”

[英]Android gradle Error:(69, 0) Gradle DSL method not found: 'compile()'

我的build.gradle文件遇到了一個非常令人沮喪的問題。 當我決定將新庫添加到項目中時,它開始了:“ Deter-master”庫。

這是錯誤消息:

Gradle同步失敗:在DefaultExternalModuleDependency {group ='com.android.support',name ='support-v13',version上找不到參數[com.android.support:appcompat-v7:25.0.0]的方法compile() = '25 .0.0',配置='default'},類型為org.gradle.api.internal.artifacts.dependencies.DefaultExternalModuleDependency。 有關更多詳細信息,請查閱IDE日志(“幫助” |“顯示日志”)

在下面可以看到所有gradle文件:

apply plugin: 'com.android.application'

ext {
    libraries = [
            support : "25.0.0",
            location: "9.8.0"
    ]
}
def config = project.ext.libraries


repositories {
    mavenCentral()
    mavenLocal()
    flatDir {
        dirs 'libs'
    }
    maven { url 'https://maven.fabric.io/public' }
}
repositories {
    maven {
        url 'https://dl.bintray.com/blipinsk/maven/'
    }
}

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.0"

    defaultConfig {
        applicationId "com.airnauts.kaktus"
        minSdkVersion 19
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
    }
    signingConfigs {
        debug {
            storeFile file("../social_keystore.jks")
            storePassword "social"
            keyAlias "social"
            keyPassword "social"
        }
        release {
            storeFile file("../social_keystore.jks")
            storePassword "social"
            keyAlias "social"
            keyPassword "social"
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

android {
    packagingOptions {
        exclude 'LICENSE.txt'
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile(name: 'toolkit', ext: 'aar')
    compile "com.android.support:support-v13:${config.support}" compile "com.android.support:appcompat-v7:${config.support}" compile "com.android.support:support-v4:${config.support}" compile "com.android.support:recyclerview-v7:${config.support}" compile "com.android.support:design:${config.support}" compile "com.android.support:cardview-v7:${config.support}" compile "com.android.support:percent:${config.support}" compile "com.google.android.gms:play-services-location:${config.location}" compile "com.google.android.gms:play-services-maps:${config.location}"
    //blipinsk
    compile 'com.firebaseui:firebase-ui-auth:0.6.2'
    compile 'com.bartoszlipinski:viewpropertyobjectanimator:1.2.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.jakewharton:butterknife:7.0.0'
    compile 'com.makeramen:roundedimageview:2.2.0'
    compile 'de.greenrobot:eventbus:2.4.0'
    compile 'uk.co.chrisjenx:calligraphy:2.1.0'
    compile 'com.facebook.android:facebook-android-sdk:4.7.0'
    compile 'me.kaelaela:verticalviewpager:1.0.0@aar'
    compile 'com.google.code.gson:gson:2.2.4'
    compile 'com.google.firebase:firebase-auth:9.8.0'
    compile 'com.firebaseui:firebase-ui:1.0.0'
    compile 'com.android.support:support-v4:25.1.0'
    compile 'com.karumi:dexter:4.1.0'
    compile project('Libraries:Dexter-master')
}

apply plugin: 'com.google.gms.google-services'

另一部分:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.2'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:3.0.0'
    }
}

allprojects {
    repositories {
        jcenter()
        flatDir {
            dirs 'libs'
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

最后一個:

include ':app'
include ':app:Libraries:Dexter-master'

嘗試更換:

compile "com.android.support:support-v13:${config.support}" compile "com.android.support:appcompat-v7:${config.support}" compile "com.android.support:support-v4:${config.support}" compile "com.android.support:recyclerview-v7:${config.support}" compile "com.android.support:design:${config.support}" compile "com.android.support:cardview-v7:${config.support}" compile "com.android.support:percent:${config.support}" compile "com.google.android.gms:play-services-location:${config.location}" compile "com.google.android.gms:play-services-maps:${config.location}"

與:

compile "com.android.support:support-v13:${config.support}"
compile "com.android.support:appcompat-v7:${config.support}"
compile "com.android.support:support-v4:${config.support}"
compile "com.android.support:recyclerview-v7:${config.support}"
compile "com.android.support:design:${config.support}"
compile "com.android.support:cardview-v7:${config.support}"
compile "com.android.support:percent:${config.support}"
compile "com.google.android.gms:play-services-location:${config.location}"
compile "com.google.android.gms:play-services-maps:${config.location}"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM