java - Gradle 错误 :Gradle DSL method not found: 'executeWithoutThrowingTaskFailure()'

标签 java android android-studio gradle android-sdk-tools

我最近将 android SDK 工具更新到 v23,现在当我打开我的项目时它无法编译,我收到此消息:

错误:找不到 Gradle DSL 方法:'executeWithoutThrowingTaskFailure()'

有人知道这里的问题是什么吗? 这是我的 app.gradle 代码:

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}

apply plugin: 'com.android.application'

apply plugin: 'io.fabric'
apply plugin: 'android-apt'
apply plugin: 'com.raizlabs.griddle'
apply plugin: 'com.neenbedankt.android-apt'

repositories {
    mavenCentral()
    maven { url 'https://maven.fabric.io/public' }
    maven { url "https://jitpack.io" }
}

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "com.myapp"
        minSdkVersion 10
        targetSdkVersion 23
        versionCode 2
        versionName "1.3.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {

    compile('com.crashlytics.sdk.android:crashlytics:2.5.0@aar') {
        transitive = true;
    }

    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:design:22.2.0'
    compile 'com.android.support:appcompat-v7:22.2.1'
    compile 'com.jakewharton:butterknife:7.0.1'
    compile 'commons-io:commons-io:2.4'
    compile 'uk.co.chrisjenx:calligraphy:2.1.0'
    compile 'com.google.code.gson:gson:2.3.1'
    compile('com.github.nkzawa:socket.io-client:0.5.0') {
        exclude group: 'org.json', module: 'json'
    }
    //http
    compile 'com.squareup.retrofit:retrofit:1.9.0'
    //db
    apt 'com.raizlabs.android:DBFlow-Compiler:2.2.1'
    compile 'com.raizlabs.android:DBFlow-Core:2.2.1'
    compile 'com.raizlabs.android:DBFlow:2.2.1'
    //graph
    compile 'com.jjoe64:graphview:4.0.1'
    compile 'com.github.PhilJay:MPAndroidChart:v2.1.3'

    compile project(':mobihelp_sdk_android_v1.5.1')
    compile 'com.facebook.android:facebook-android-sdk:4.1.0'

    compile 'com.apptentive:apptentive-android:1.7.3@aar'

    compile "com.mixpanel.android:mixpanel-android:4.6.2"
    compile "com.google.android.gms:play-services:3.1+"
    compile 'com.github.lzyzsd:circleprogress:1.1.0@aar'

    compile 'com.readystatesoftware.systembartint:systembartint:1.0.3'
}

最佳答案

我可能会迟到,但我的情况不同,我需要导入 2 个 maven URL,所以我在 gradle 中写的是:

maven 
{
    url 'https://maven.fabric.io/public', 
    url 'https://jitpack.io
}

我应该这样写的地方:

maven { url 'https://maven.fabric.io/public' }
maven { url 'https://jitpack.io' }

关于java - Gradle 错误 :Gradle DSL method not found: 'executeWithoutThrowingTaskFailure()' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33913627/

相关文章:

android - Android构建错误 'Failed to read androiddebugkey from store'

java - Java Web 服务中的单例对象

java - 如何通过 Spring REST Controller 将文件路径作为字符串传递给 DAO 类以存储在数据库中

android - 防止在方向更改时全屏退出(窗口标志清除?)

android - 通过 setInputType() 设置输入类型后,自定义 EditText 不起作用

android - 如何解决 Gfx 开发内存的使用问题

java - 通过 JS 调用 JSF 方法

java - 从构造函数创建对象

java - org.openqa.selenium.SessionNotCreatedException:无法创建新的远程 session 。在模拟器中初始化android驱动程序时

android - 添加注解处理器时,Android Studio会引发重复的类错误