项目'反馈'可能正在使用不包含该方法的Android Gradle插件版本(例如,在1.1.0中添加了' testCompile')。 修复插件版本和同步项目 项目'反馈'可能正在使用不包含该方法的Gradle版本。 打开Gradle包装器文件 构建文件可能缺少Gradle插件。 申请Gradle插件
//顶级构建文件,您可以在其中添加所有子项目/模块共有的配置选项。
buildscript {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
// The Fabric Gradle plugin uses an open ended version to react
// quickly to Android tooling updates
classpath 'io.fabric.tools:gradle:1.+'
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
//模块:app gradle文件
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "burpp.av.feedback"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile('com.crashlytics.sdk.android:crashlytics:2.5.6@aar') {
transitive = true;
}
compile('com.crashlytics.sdk.android:answers:1.3.7@aar') {
transitive = true;
}
compile('com.appsee:appsee-android:2.2@aar') {
transitive = true;
}
compile('io.fabric.sdk.android:fabric:1.3.10@aar') {
transitive = true;
}
compile 'com.android.support:appcompat-v7:24.0.0-beta1'
compile 'com.android.support:design:24.0.0-beta1'
compile 'com.google.android.gms:play-services:9.0.2'
compile 'org.apache.httpcomponents:httpclient:4.3.5'
compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
compile 'com.google.android.gms:play-services-ads:9.0.2'
compile 'com.google.android.gms:play-services-auth:9.0.2'
compile 'com.google.android.gms:play-services-gcm:9.0.2'
}
答案 0 :(得分:10)
您必须在classpath
块内插入buildscript
个依赖项。
buildscript {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
// move it here
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
// The Fabric Gradle plugin uses an open ended version to react
// quickly to Android tooling updates
classpath 'io.fabric.tools:gradle:1.+'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir