任务':app:compileDebugJavaWithJavac'执行失败。 >编译失败

时间:2018-03-19 11:48:53

标签: android

大家好,这是我在运行应用程序时遇到的错误。我对android更新,所以我无法得到结果。我已经通过一些技术网站,它建议更改版本(编译SDK版本和构建工具版本),但我无法解决这个问题。任何人都可以帮我解决这个问题吗?

错误讯息:

错误:任务':app:compileDebugJavaWithJavac'执行失败。

  

编译失败;有关详细信息,请参阅编译器错误输出。

Android Build.gradle文件。

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

    dependencies {
        classpath 'io.fabric.tools:gradle:1.24.4'
    }
}
apply plugin: 'com.android.application'

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

apply plugin: 'io.fabric'

android {
    compileSdkVersion 25
    buildToolsVersion "26.0.2"
    repositories {
        maven {
            url 'https://maven.google.com'
        }
        maven { url 'https://maven.fabric.io/public' }
    }
    defaultConfig {
        applicationId "com.smartgladiator.link"
        minSdkVersion 21
        targetSdkVersion 25
        // Enabling multidex support.
        multiDexEnabled true
        vectorDrawables.useSupportLibrary = true
        versionCode 2
//        versionName "1.0.37.1"
        versionName "1.0.38"
    }
    dexOptions {

        jumboMode true
        javaMaxHeapSize "4g"

    }
    buildTypes {
        release {
            minifyEnabled false
            shrinkResources false
            zipAlignEnabled true
            debuggable false
            lintOptions {
                disable 'MissingTranslation'
                disable 'ResourceType'
            }
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    packagingOptions {
        exclude 'META-INF/ASL2.0'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE'
    }

    useLibrary 'org.apache.http.legacy'
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    //noinspection GradleCompatible
    compile 'com.android.support:appcompat-v7:25.4.0'
    compile 'com.android.support:design:25.4.0'
    compile 'com.android.support:customtabs:25.4.0'
    compile 'com.android.support:multidex:1.0.2'
    compile 'com.android.support:support-v13:25.4.0'
    //compile 'com.android.support:multidex:1.0.1'

    //to make supported components
    compile 'com.android.support:support-v4:25.4.0'
    compile 'com.android.support:recyclerview-v7:25.4.0'
    compile 'org.glassfish.tyrus.tests.servlet:tyrus-tests-servlet-autobahn-server:1.12'
    compile 'org.glassfish.tyrus.tests:tyrus-tests-servlet-autobahn-server:1.0-b13'
    compile 'com.github.nkzawa:socket.io-client:0.3.0'
    compile 'com.baoyz.actionsheet:library:1.1.7'
    compile 'com.baoyz.swipemenulistview:library:1.3.0'
    compile 'com.daimajia.swipelayout:library:1.2.0@aar'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.makeramen:roundedimageview:2.3.0'
    compile 'com.squareup.retrofit2:retrofit:2.1.0'
    compile 'com.google.code.gson:gson:2.8.0'
    compile 'com.fasterxml.jackson.core:jackson-databind:2.7.3'
    compile 'com.squareup.retrofit2:converter-gson:2.1.0'
    compile 'com.squareup.okhttp3:logging-interceptor:3.3.1'
    compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
    compile 'com.daimajia.swipelayout:library:1.2.0@aar'
    compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
        transitive = true;
    }
    compile project(':speech')
//    debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.4'
}

1 个答案:

答案 0 :(得分:0)

确保正确设置了android sdk localtion

ANDROID_HOME = home / user / android_sdk /"这是正确的位置"

ANDROID_HOME = home / user / android_sdk / tools"错误路径"

降级您的gradle版本