ОШИБКА: метод Gradle DSL не найден: 'Android ()' - PullRequest
0 голосов
/ 06 января 2020

Я испробовал все три решения, но ни одно из них не решило проблему. ОШИБКА: метод Gradle DSL не найден: 'Android ()' Возможные причины: возможно, в проекте 'hope' используется версия плагина Android Gradle, который не содержит метод (например, добавлен 'testCompile') в 1.1.0). Обновите плагин до версии 3.5.3 и syn c project

Возможно, в проекте 'hope' используется версия Gradle, которая не содержит метод. Откройте файл оболочки Gradle

В файле сборки может отсутствовать плагин Gradle. Применить плагин Gradle

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.27.1'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
    maven { url 'https://maven.fabric.io/public' }
}


android {
    compileSdkVersion 28
    buildToolsVersion '28.0.3'
    defaultConfig {
        applicationId "com.dot.name"
        minSdkVersion 19
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])


    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    }) Android Gradle Plugin
    implementation group: 'org.jsoup', name: 'jsoup', version: '1.12.1'

    implementation 'com.android.support:appcompat-v7:28.0.3'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:design:28.0.3'
    implementation 'com.jakewharton:butterknife:10.2.1'
    implementation 'com.android.support:support-v4:28.0.3'
    androidTestImplementation 'junit:junit:4.13'
    androidTestImplementation 'org.awaitility:awaitility:4.0.2'
    annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
    implementation 'com.android.support:cardview-v7:28.0.3'
    implementation('com.crashlytics.sdk.android:crashlytics:2.10.1@aar') {
        transitive = true;
    }

}

allprojects {
    repositories {

        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }

    }
}
buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}






task clean(type: Delete) {
    delete rootProject.buildDir
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.3'




        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}
...