0

I was trying to build app which shows data from my aws DB to my android phone. While building, it was showing following error:

Error:Execution failed for task ':app:transformJackWithJackForDebug'.

com.android.build.api.transform.TransformException: com.android.builder.core.JackToolchain$ToolchainException: Something out of Jack control has happened: 'directory on disk with cache' VFS in directory 'C:\Users\Yash\AndroidStudioProjects\CAR2\app\build\intermediates\incremental\transformJackWithJackForDebug' has an unexpected bad format: file 'C:\Users\Yash\AndroidStudioProjects\CAR2\app\build\intermediates\incremental\transformJackWithJackForDebug\4F\DA0195435AA1E7B7891D5CABEB24207C48EFB6' does not exist

I don't know what this means as this is my first time with DB in android.

Following is my gradle script:

apply plugin: 'com.android.application'
sourceCompatibility = '1.7'
targetCompatibility = '1.7'
android {
    compileSdkVersion 26
    buildToolsVersion "26.0.2"

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
        defaultConfig {
            applicationId "com.example.yash.car2"
            minSdkVersion 21
            targetSdkVersion 26
            versionCode 1
            versionName "1.0"
            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
            jackOptions {
                enabled true
            }
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }
    dependencies {
        compile 'com.amazonaws:aws-android-sdk-core:2.2.+'
        compile 'com.amazonaws:aws-android-sdk-s3:2.2.+'
        compile project(':mysql-connector-java-5.1.44-bin')

//        sourceCompatibility JavaVersion.VERSION_1_8
        //  targetCompatibility JavaVersion.VERSION_1_8

    }
    allprojects {
        repositories {
            jcenter()
            maven {
                url "https://maven.google.com"
            }
        }
    }
        dependencies {
        sourceCompatibility = '1.7'
        targetCompatibility = '1.7'
        compile fileTree(dir: 'libs', include: ['*.jar'])
        androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
            exclude group: 'com.android.support', module: 'support-annotations'
        })
        compile 'com.android.support:appcompat-v7:26.0.2'
        compile 'com.android.support.constraint:constraint-layout:1.0.2'
        testCompile 'junit:junit:4.12'
        compile 'com.android.support:design:26.0.2'
    }
}

pls Help!

Cédric Julien
  • 78,516
  • 15
  • 127
  • 132
Yash
  • 59
  • 6
  • 3
    Possible duplicate of [Error:Execution failed for task ':app:transformJackWithJackForDebug'](https://stackoverflow.com/questions/39659110/errorexecution-failed-for-task-apptransformjackwithjackfordebug) – Vidhi Dave Oct 23 '17 at 09:28
  • @VishvaDave but no answer! – Yash Oct 23 '17 at 09:44

1 Answers1

0

this is the perfect way

android {
...
defaultConfig {
    ...
    jackOptions {
        enabled true
    }
}

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
    }
}
Sandeep Manmode
  • 395
  • 4
  • 15