2016-06-07 2 views
1

Gradle DSL method not found : 'classpath()'

  • 프로젝트 'FeedBack'에 메소드가 포함되어 있지 않은 Android Gradle 플러그인 버전이 사용되었을 수 있습니다 (예 : 'testCompile'이 1.1에 추가되었습니다. 0). 플러그인 버전 수정 및 프로젝트 동기화
  • 'FeedBack'프로젝트에 메소드가 포함되지 않은 버전의 Gradle이 사용 중일 수 있습니다. 열기 Gradle 래퍼 파일
  • 빌드 파일에 Gradle 플러그인이 누락되었을 수 있습니다. 모든 하위 프로젝트/모듈에 공통 구성 옵션을 추가 할 수 Gradle을 플러그인을
  • // 최고 수준의 빌드 파일을 적용합니다.

    buildscript { 
        repositories { 
         jcenter() 
    
         maven { url 'https://maven.fabric.io/public' } 
        } 
    } 
    
    dependencies { 
        classpath 'com.android.tools.build:gradle:2.1.0' 
    
        // NOTE: Do not place your application dependencies here; they belong 
        // in the individual module build.gradle files 
    
        // The Fabric Gradle plugin uses an open ended version to react 
        // quickly to Android tooling updates 
        classpath 'io.fabric.tools:gradle:1.+' 
    
    } 
    
    allprojects { 
        repositories { 
         jcenter() 
        } 
    } 
    
    task clean(type: Delete) { 
        delete rootProject.buildDir 
    

    // 모듈 : 응용 프로그램 Gradle을 파일

    apply plugin: 'com.android.application' 
    apply plugin: 'io.fabric' 
    
    android { 
        compileSdkVersion 23 
        buildToolsVersion "23.0.3" 
    
        defaultConfig { 
         applicationId "burpp.av.feedback" 
         minSdkVersion 14 
         targetSdkVersion 23 
         versionCode 1 
         versionName "1.0" 
    
         multiDexEnabled true 
        } 
        buildTypes { 
         release { 
          minifyEnabled false 
          proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
         } 
        } 
    } 
    
    dependencies { 
        compile fileTree(dir: 'libs', include: ['*.jar']) 
        testCompile 'junit:junit:4.12' 
    
        compile('com.crashlytics.sdk.android:crashlytics:[email protected]') { 
         transitive = true; 
        } 
    
        compile('com.crashlytics.sdk.android:answers:[email protected]') { 
         transitive = true; 
        } 
    
        compile('com.appsee:appsee-android:[email protected]') { 
         transitive = true; 
        } 
        compile('io.fabric.sdk.android:fabric:[email protected]') { 
         transitive = true; 
        } 
        compile 'com.android.support:appcompat-v7:24.0.0-beta1' 
        compile 'com.android.support:design:24.0.0-beta1' 
        compile 'com.google.android.gms:play-services:9.0.2' 
        compile 'org.apache.httpcomponents:httpclient:4.3.5' 
        compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2' 
        compile 'com.google.android.gms:play-services-ads:9.0.2' 
        compile 'com.google.android.gms:play-services-auth:9.0.2' 
        compile 'com.google.android.gms:play-services-gcm:9.0.2' 
    } 
    
    +0

    사용중인 AS 버전은 무엇입니까? 최신 플러그인을 crashlytics와 함께 사용하려면 최신 버전을 사용해야합니다. – NightFury

    +0

    Android Studio 2.1.2 –

    답변

    8

    당신은 buildscript 블록 내부 classpath 의존성을 삽입해야합니다.

    buildscript { 
        repositories { 
         jcenter() 
    
         maven { url 'https://maven.fabric.io/public' } 
        } 
    
        // move it here 
        dependencies { 
         classpath 'com.android.tools.build:gradle:2.1.0' 
    
         // NOTE: Do not place your application dependencies here; they belong 
         // in the individual module build.gradle files 
    
         // The Fabric Gradle plugin uses an open ended version to react 
         // quickly to Android tooling updates 
         classpath 'io.fabric.tools:gradle:1.+' 
        } 
    } 
    
    
    
    allprojects { 
        repositories { 
         jcenter() 
        } 
    } 
    
    task clean(type: Delete) { 
        delete rootProject.buildDir 
    
    +0

    당신 말이 맞습니다. 감사합니다 ... –

    +0

    @AbdulGaffar 맞은 사람이 맞다면 대답을 수락하십시오 –

    +0

    내 경우에는 작동하지 않습니다 –