ОШИБКА: метод Gradle DSL не найден: 'google ()' с плагином android 3.5.3 - PullRequest
0 голосов
/ 07 февраля 2020
ERROR: Gradle DSL method not found: 'google()'
Possible causes:
The project 'app' 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).
Upgrade plugin to version 3.5.3 and sync project

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

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

gradle-wrapper.properties

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip

build.gradle:

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

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


allprojects {
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com'
        }
    }
}

приложение:

android {
    compileSdkVersion 28
    buildToolsVersion '28.0.3'
    defaultConfig {
        applicationId 'com.one.monitor'
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1301141122
        versionName "1.3.4"
        multiDexEnabled true
        ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
    }
...