简体   繁体   English

摇篮显示一些错误

[英]Gradle is showing some error

I was trying to build app which shows data from my aws DB to my android phone. 我正在尝试构建可将数据从我的AWS数据库显示到我的Android手机的应用。 While building, it was showing following error: 在构建时,它显示以下错误:

Error:Execution failed for task ':app:transformJackWithJackForDebug'. 错误:任务':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 com.android.build.api.transform.TransformException:com.android.builder.core.JackToolchain $ ToolchainException:发生了杰克控制之外的事情:'具有缓存的磁盘上的目录'VFS位于目录'C:\\ Users \\ Yash \\ AndroidStudioProjects \\ CAR2 \\ app \\ build \\ intermediates \\ incremental \\ transformJackWithJackForDebug'具有意外的错误格式:文件'C:\\ Users \\ Yash \\ AndroidStudioProjects \\ CAR2 \\ app \\ build \\ intermediates \\ incremental \\ transformJackWithJackForDebug \\ 4F \\ DA0195435AA1E7B7896DCCA不存在

I don't know what this means as this is my first time with DB in android. 我不知道这意味着什么,因为这是我第一次使用android中的DB。

Following is my gradle script: 以下是我的gradle脚本:

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! 请帮助!

this is the perfect way 这是完美的方法

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

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM