我正在尝试使用Java 8编译我的Android项目。我收到此错误:
Error:Library writing phase: I/O error when accessing file 'E:\AndroidStudio-workspace\AndroidStudio-workspace\AndroidJava8App\app\build\intermediates\transforms\preJackPackagedLibraries\debug\jars\8000\1f\classes-7e6b8fc7be3a8d7a00b87d2dcaca08e2b16b5802.jar': directory 'C:\Users\quares\AppData\Local\Temp\vfs-1490037714211-0' failed to be closed: Failed to delete directory 'C:\Users\quares\AppData\Local\Temp\vfs-1490037714211-0'
Error:Execution failed for task ':app:transformClassesWithPreJackPackagedLibrariesForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.core.JackToolchain$ToolchainException: Jack compilation exception
这是我的一些gradle文件:
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "quares.androidjava8app"
minSdkVersion 15
targetSdkVersion 25
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'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
incremental false
}
}
以下是该模块的屏幕截图:
您可以看到,我正在使用Android 25版本进行编译,并且已为我的项目安装并配置了Java 8。
有什么建议吗?我已经阅读了很多问题和答案,但没有一个能帮助我。
谢谢!