gpt4 book ai didi

java - 错误: Could not find method android() for arguments

转载 作者:行者123 更新时间:2023-12-02 09:30:19 25 4
gpt4 key购买 nike

我遇到一个问题,当我同步我的项目时,会发生此 gradle 错误:(

ERROR: Could not find method android() for arguments [build_4igxve2xutpcfkae0ab7hnkia$_run_closure1@353dd2ed] on project ':app' of type org.gradle.api.Project. Open File

这是我的 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(Module:App)

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'

最佳答案

您的模块 build.gradle 文件顶部似乎缺少这一行:

apply plugin: 'com.android.application'

关于java - 错误: Could not find method android() for arguments,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58040757/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com