升级到Android Studio2.2preview和gradle插件2.2alpha2之后,我开始得到以下错误,并将cucumber-java作为依赖之一
Caused by: org.gradle.api.UncheckedIOException: java.io.IOException: Failed to read zip file '/mypath/app/build/intermediates/transforms/proguard/androidTest/dev/jars/3/1f/main.jar'.
at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:43)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:78)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.java:244)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:220)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.java:231)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:209)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
... 60 more
Caused by: java.io.IOException: Failed to read zip file '/mypath/app/build/intermediates/transforms/proguard/androidTest/dev/jars/3/1f/main.jar'.
at com.android.builder.internal.packaging.zip.ZFile.<init>(ZFile.java:404)
at com.android.builder.internal.packaging.zip.ZFile.<init>(ZFile.java:348)
at com.android.builder.files.IncrementalRelativeFileSets.fromZip(IncrementalRelativeFileSets.java:105)
at com.android.builder.files.IncrementalRelativeFileSets.fromZip(IncrementalRelativeFileSets.java:84)
at com.android.builder.files.IncrementalRelativeFileSets.fromZipsAndDirectories(IncrementalRelativeFileSets.java:258)
at com.android.build.gradle.tasks.PackageAndroidArtifact.doFullTaskAction(PackageAndroidArtifact.java:291)
at com.android.build.gradle.tasks.PackageApplication.doFullTaskAction(PackageApplication.java:73)
at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:88)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
... 66 more
Caused by: java.io.IOException: Failed to read directory entry index 5072 (total directory bytes read: 558556).
at com.android.builder.internal.packaging.zip.CentralDirectory.makeFromData(CentralDirectory.java:233)
at com.android.builder.internal.packaging.zip.ZFile.readCentralDirectory(ZFile.java:650)
at com.android.builder.internal.packaging.zip.ZFile.readData(ZFile.java:472)
at com.android.builder.internal.packaging.zip.ZFile.<init>(ZFile.java:399)
... 74 more
Caused by: java.io.IOException: Failed to read stored entry 'cucumber/api/java/ar/اذاً.class'.
at com.android.builder.internal.packaging.zip.CentralDirectory.readEntry(CentralDirectory.java:359)
at com.android.builder.internal.packaging.zip.CentralDirectory.makeFromData(CentralDirectory.java:230)
... 77 more
Caused by: java.io.IOException: Failed to read data descriptor record.
at com.android.builder.internal.packaging.zip.StoredEntry.<init>(StoredEntry.java:274)
at com.android.builder.internal.packaging.zip.CentralDirectory.readEntry(CentralDirectory.java:357)
... 78 more
Caused by: java.io.IOException: Incorrect value for field 'CRC32': value is 24904624 but 310353179 expected.
at com.android.builder.internal.packaging.zip.ZipField.verify(ZipField.java:209)
at com.android.builder.internal.packaging.zip.StoredEntry.readDataDescriptorRecord(StoredEntry.java:475)
at com.android.builder.internal.packaging.zip.StoredEntry.<init>(StoredEntry.java:272)
... 79 more
看起来它不是在读阿拉伯语,我也在下面设置
compileOptions {
encoding "UTF-8"
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
但仍然没有运气
答案 0 :(得分:2)
这是Gradle插件中的一个错误,他们已经修复了它,修复程序将在下一个版本(rc1)中提供。错误报告:https://code.google.com/p/android/issues/detail?id=221057
答案 1 :(得分:0)
根据niqueco的回答: 在项目级别build.gradle使用gradle插件版本2.2.3。
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
}
}
重启Android工作室,它应该可行