ОШИБКА: не удалось найти метод android () для аргументов - PullRequest
0 голосов
/ 21 сентября 2019

Я сталкиваюсь с проблемой, когда я синхронизирую свой проект, возникает ошибка gradle: (

ОШИБКА: Не удалось найти метод android () для аргументов [build_4igxve2xutpcfkae0ab7hnkia $ _run_closure1@ 353dd2ed] для проекта ": приложение" типа org.gradle.api.Project. Открыть файл

Это мой Build.gradle (проект: имя)

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

buildscript {
    repositories {
        google()
        jcenter()

    }
    dependencies {
        //classpath 'com.android.tools.build:gradle:3.0.0-beta6'
        classpath 'com.android.tools.build:gradle:2.3.3'
        classpath 'com.google.gms:google-services:4.3.2'


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

allprojects {
    repositories {
        google()
        jcenter()

    }
}

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

Это мой build.gradle (Модуль: Приложение)

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


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

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.google.firebase:firebase-auth:16.0.1'
    implementation 'com.google.firebase:firebase-database:16.0.1'
    implementation 'com.google.firebase:firebase-storage:16.0.1'
    implementation 'com.google.firebase:firebase-core:16.0.1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.android.support:design:28.0.0'


    implementation 'com.google.firebase:firebase-analytics:17.2.0'
//androidTestImplementation 'com.android.support.test:runner28.0.0'
}
apply plugin: 'com.google.gms.google-services'

1 Ответ

1 голос
/ 21 сентября 2019

Похоже, вам не хватает этой строки в верхней части файла build.gradle вашего модуля:

apply plugin: 'com.android.application'
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...