gpt4 book ai didi

java - Gradle 突然无法构建。找不到 Gradle DSL 方法 : 'android()'

转载 作者:行者123 更新时间:2023-11-30 01:52:06 24 4
gpt4 key购买 nike

我的 Gradle 突然决定不再构建我的项目,我不知道。我怀疑是因为它在 Dropbox 上,但在我处理它的那个月里它一直不是问题。我没有在构建文件中编辑任何内容。我将 java JDK 更新到最新版本,并确保项目指向它。 gradle 看起来像这样;

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}

android {
compileSdkVersion 22
}
dependencies {
}

apply plugin: 'com.android.application'

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"

defaultConfig {
applicationId "com.example.nan.spymap"
minSdkVersion 21
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories { mavenCentral() }

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

compile 'com.facebook.android:facebook-android-sdk:4.6.0'
compile 'com.google.android.gms:play-services:7.8.0'
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.android.support:appcompat-v7:22.1.0'
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.parse.bolts:bolts-android:1.+'
compile fileTree(dir: 'libs', include: 'Parse-*.jar')
compile 'com.android.support:design:22.2.0'

}

最佳答案

项目(顶层)的build.gradle文件不能包含android根标签。尝试将其删除。

关于java - Gradle 突然无法构建。找不到 Gradle DSL 方法 : 'android()' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32876503/

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