gpt4 book ai didi

android - Gradle 显示一些错误

转载 作者:行者123 更新时间:2023-12-03 05:52:37 25 4
gpt4 key购买 nike

我正在尝试构建可将数据从我的AWS数据库显示到我的Android手机的应用。
在构建时,它显示以下错误:

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



我不知道这意味着什么,因为这是我第一次使用android中的DB。

以下是我的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'
}
}

请帮助!

最佳答案

这是完美的方式

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

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

关于android - Gradle 显示一些错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46885877/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com