gpt4 book ai didi

android - defaultConfig、buildTypes、packagingOptions 和依赖项不能应用于 (groovy.lang.Closure)

转载 作者:太空狗 更新时间:2023-10-29 14:06:34 25 4
gpt4 key购买 nike

我知道这个问题以前是答案,但没有一个对我有用。该应用程序编译和运行完美,但这个警告很烦人。基本上,移动 gradle 中的 defaultConfig、buildTypes、packagingOptions 和 dependencies,以及顶级 gradle 中的 dependencies 都会给出 cannot be applied to (groovy.lang.Closure) 警告:

顶级gradle:

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

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

allprojects {
repositories {
jcenter()
}
}

移动端:

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

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"

defaultConfig {
applicationId "net.udazz.udazz"
minSdkVersion 11
targetSdkVersion 22
versionCode 1
versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'LICENSE.txt'
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services-gcm:7.5.+'

compile 'com.android.support:appcompat-v7:22.2.1'

// Testing dependencies
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.1'
androidTestCompile 'com.android.support.test:runner:0.2'
androidTestCompile 'com.android.support:support-annotations:22.2.1'
}

最佳答案

我有同样的问题,更新到 gradle 1.3.1 对我有用。

类路径 'com.android.tools.build:gradle:1.3.1'

关于android - defaultConfig、buildTypes、packagingOptions 和依赖项不能应用于 (groovy.lang.Closure),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31967933/

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