Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle DSL method not found: 'classpath()'

  • The project 'FeedBack' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0). Fix plugin version and sync project
  • The project 'FeedBack' may be using a version of Gradle that does not contain the method. Open Gradle wrapper file
  • The build file may be missing a Gradle plugin. Apply Gradle plugin
  • // Top-level build file where you can add configuration options common to all sub-projects/modules.

    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
    

    //Module: app gradle file

    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:2.5.6@aar') {
            transitive = true;
        }
    
        compile('com.crashlytics.sdk.android:answers:1.3.7@aar') {
            transitive = true;
        }
    
        compile('com.appsee:appsee-android:2.2@aar') {
            transitive = true;
        }
        compile('io.fabric.sdk.android:fabric:1.3.10@aar') {
            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'
    }
    
    like image 645
    Abdul Gaffar Avatar asked Dec 01 '22 16:12

    Abdul Gaffar


    1 Answers

    You have to insert classpath dependencies inside buildscript block.

    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
    
    like image 60
    Giorgio Antonioli Avatar answered Dec 04 '22 12:12

    Giorgio Antonioli