Android Studio / Gradle:proguardRelease FAILED

时间:2014-12-29 20:00:34

标签: android android-studio proguard android-gradle build.gradle

使用Android Studio,我收到了proguardRelease FAILED错误:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':appName:proguardAppNameRelease'.
> 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to  
get more log output.

BUILD FAILED

从命令行执行stacktrace:

./gradlew assembleRelease -d --stacktrace

这就是我得到的:

20:45:07.245 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
20:45:07.246 [ERROR] [org.gradle.BuildExceptionReporter]
20:45:07.246 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
20:45:07.246 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':OrariTrenitaliaApps:proguardOrariTrenitaliaFreeRelease'.
20:45:07.246 [ERROR] [org.gradle.BuildExceptionReporter] > 1
20:45:07.246 [ERROR] [org.gradle.BuildExceptionReporter]
20:45:07.247 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
20:45:07.247 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task  ':OrariTrenitaliaApps:proguardOrariTrenitaliaFreeRelease'.
20:45:07.248 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
20:45:07.248 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
20:45:07.248 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
20:45:07.248 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
20:45:07.248 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
20:45:07.248 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
20:45:07.249 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
20:45:07.249 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
20:45:07.249 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
20:45:07.249 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:305)
.....
20:45:07.256 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
20:45:07.256 [ERROR] [org.gradle.BuildExceptionReporter]    at proguard.classfile.editor.InterfaceDeleter.visitSignatureAttribute(InterfaceDeleter.java:162)
20:45:07.256 [ERROR] [org.gradle.BuildExceptionReporter]    at proguard.classfile.attribute.SignatureAttribute.accept(SignatureAttribute.java:97)
20:45:07.257 [ERROR] [org.gradle.BuildExceptionReporter]    at proguard.classfile.ProgramClass.attributesAccept(ProgramClass.java:547)
20:45:07.257 [ERROR] [org.gradle.BuildExceptionReporter]    at proguard.classfile.editor.InterfaceDeleter.visitProgramClass(InterfaceDeleter.java:92)
20:45:07.257 [ERROR] [org.gradle.BuildExceptionReporter]    at proguard.shrink.ClassShrinker.visitProgramClass(ClassShrinker.java:78)
20:45:07.258 [ERROR] [org.gradle.BuildExceptionReporter]    at proguard.classfile.visitor.MultiClassVisitor.visitProgramClass(MultiClassVisitor.java:85)
20:45:07.258 [ERROR] [org.gradle.BuildExceptionReporter]    at proguard.shrink.UsedClassFilter.visitProgramClass(UsedClassFilter.java:62)

我该如何解决?

1 个答案:

答案 0 :(得分:0)

似乎Scala中存在一个影响Proguard 5.1的错误:

http://sourceforge.net/p/proguard/bugs/552/