Я получаю следующую ошибку ERROR: Could not find method android() for arguments [build_9fawur68cjcg5sfkvki95w8sr$_run_closure1@30cec325] on project ':app' of type org.gradle.api.Project.
Я не уверен, почему я получаю эту ошибку, и я пробовал много других вещей, чтобы посмотреть, смогу ли я заставить ее работать.Хотя это никогда не происходит.
Gradle уровня приложения был изменен много раз, ни один из которых не решает проблему.Gradle уровня проекта тоже не работает.
Gradle уровня приложения
android {
compileSdkVersion 28
defaultConfig {
applicationId "net.troop59.LoginFirebase"
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:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-core:16.0.6'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:28.0.0'
//add this line
compile 'com.google.firebase:firebase-auth:16.1.0'
}
apply plugin: "com.google.gms.google-services"
Gradle уровня проекта
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}