0

After updating android studio 2.2 I am getting compilation error. Can you please help me in this regard?

Error:Execution failed for task ':app:compileDebugJavaWithJavac'

My Gradle file is: (Project)

    // 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.3.0'

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

    allprojects {
        repositories {
            jcenter()
        }
    }

    task clean(type: Delete) {
        delete rootProject.buildDir
    }
---------------------------------------------------------------------------

My Gradle file is: (Module)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.test"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 2
        versionName "1.1"
    }
    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.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
    compile 'com.android.support:cardview-v7:23.1.1'
    compile 'commons-io:commons-io:1.3.2'
    compile 'com.google.code.gson:gson:2.4'
    compile 'de.hdodenhof:circleimageview:1.2.1'
    compile 'com.jpardogo.materialtabstrip:library:1.1.0'
    compile 'com.facebook.android:facebook-android-sdk:4.15.0'
}
Saidur Rahman
  • 546
  • 2
  • 4
  • 20
  • Have you set environment variable for java? Post your error log – madhan kumar Oct 02 '16 at 07:15
  • @madhankumar environment variable is there JAVA_HOME C:\Program Files\Java\jdk1.7.0_55 Error log is: Error:Execution failed for task ':app:compileDebugJavaWithJavac'. > Cannot find System Java Compiler. Ensure that you have installed a JDK (not just a JRE) and configured your JAVA_HOME system variable to point to the according directory. – Saidur Rahman Oct 02 '16 at 07:27
  • [Running Gradle project via Eclipse errors “system Cannot find System Java Compiler”](http://stackoverflow.com/questions/16913397/running-gradle-project-via-eclipse-errors-system-cannot-find-system-java-compil) Refer the first answer in the link. – madhan kumar Oct 02 '16 at 07:47
  • @madhankumar eclipse and adroid 2.2 settings are not same. – Saidur Rahman Oct 02 '16 at 07:57
  • yes the question related to eclipse. But look at first answer that guy tried in android studio. – madhan kumar Oct 02 '16 at 08:00
  • This solution did not work for me. I tried this solution. – Saidur Rahman Oct 02 '16 at 09:43

0 Answers0