2016-03-12 23 views
6

私は解放のために私のアプリに署名しようとしているし、それを正しく構築し、しかし、私は、私は次のようなエラーにエラー:実行は「タスクに失敗しました:アプリ:transformClassesAndResourcesWithProguardForRelease

Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease 

私を取得していますProguardを有効にしますGradleの

buildTypes { 
     release { 
      minifyEnabled true 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
    lintOptions { 
     disable 'InvalidPackage' 
    } 
    packagingOptions { 
     exclude 'META-INF/services/javax.annotation.processing.Processor' 
     exclude 'META-INF/DEPENDENCIES.txt' 
     exclude 'META-INF/LICENSE.txt' 
     exclude 'META-INF/NOTICE.txt' 
     exclude 'META-INF/NOTICE' 
     exclude 'META-INF/LICENSE' 
     exclude 'META-INF/DEPENDENCIES' 
     exclude 'META-INF/notice.txt' 
     exclude 'META-INF/license.txt' 
     exclude 'META-INF/dependencies.txt' 
     exclude 'META-INF/LGPL2.1' 
    } 
} 

repositories { 
    mavenCentral() 
    jcenter() 
    maven { 
     url 'https://esri.bintray.com/arcgis' 
    } 
} 
dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    testCompile 'junit:junit:4.12' 
    compile project(':StickyListHeaders') 
    compile files('libs/org.apache.commons.io.jar') 
    compile files('libs/json-20140107.jar') 
    compile project(':ParallaxEverywhere') 
    compile files('libs/nineoldandroids-2.4.0.jar') 
    compile files('libs/gson-2.5.jar') 
    compile project(':FlowLayout') 
    compile 'com.android.support:design:23.2.0' 
    compile 'com.android.support:appcompat-v7:23.2.0' 
    compile 'com.jakewharton:butterknife:7.0.1' 
    compile 'com.android.support:support-v4:23.2.0' 
    compile 'com.android.support:recyclerview-v7:23.2.0' 
    compile 'com.android.support:cardview-v7:23.2.0' 
    compile 'com.esri.arcgis.android:arcgis-android:10.2.7' 
    compile 'jp.wasabeef:blurry:1.0.5' 
    compile 'com.github.bumptech.glide:glide:3.6.1' 
    compile 'com.makeramen:roundedimageview:2.2.1' 
    compile 'com.daimajia.easing:library:[email protected]' 
    compile 'com.daimajia.androidanimations:library:[email protected]' 
    compile 'org.apache.commons:commons-lang3:3.1' 
    compile 'com.lifeofcoding:cacheutilslibrary:[email protected]' 
    compile 'com.edmodo:rangebar:1.0.0' 

} 

と私ProGuardのルールはファイルファイル

-keep class butterknife.** { *; } 
-dontwarn butterknife.internal.** 
-keep class **$$ViewBinder { *; } 

-keepclasseswithmembernames class * { 
    @butterknife.* <fields>; 
} 

-keepclasseswithmembernames class * { 
    @butterknife.* <methods>; 
} 

と、ここでは、スタックトレース

Exception is: 
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'. 
     at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69) 
     at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46) 
     at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35) 
     at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64) 
     at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58) 
     at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52) 
     at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52) 
     at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53) 
     at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) 
     at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203) 
     at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185) 
     at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66) 
     at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50) 
     at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25) 
     at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110) 
     at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37) 
     at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37) 
     at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23) 
     at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43) 
     at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32) 
     at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37) 
     at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30) 
     at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:154) 
     at org.gradle.internal.Factories$1.create(Factories.java:22) 
     at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90) 
     at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52) 
     at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:151) 
     at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32) 
     at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:99) 
     at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:93) 
     at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90) 
     at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62) 
     at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:93) 
     at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:82) 
     at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:94) 
     at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28) 
     at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35) 
     at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43) 
     at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28) 
     at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:78) 
     at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:48) 
     at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:51) 
     at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28) 
     at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43) 
     at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:170) 
     at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237) 
     at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210) 
     at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35) 
     at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24) 
     at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206) 
     at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169) 
     at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33) 
     at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22) 
     at org.gradle.launcher.Main.doAction(Main.java:33) 
     at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45) 
     at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54) 
     at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35) 
     at org.gradle.launcher.GradleMain.main(GradleMain.java:23) 
     at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30) 
     at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129) 
     at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61) 
Caused by: java.lang.RuntimeException: java.io.IOException: Please correct the above warnings first. 
     at com.android.builder.tasks.Job.awaitRethrowExceptions(Job.java:79) 
     at com.android.build.gradle.internal.transforms.ProGuardTransform.transform(ProGuardTransform.java:209) 
     at com.android.build.gradle.internal.pipeline.TransformTask$3.call(TransformTask.java:178) 
     at com.android.build.gradle.internal.pipeline.TransformTask$3.call(TransformTask.java:174) 
     at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.java:55) 
     at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.java:47) 
     at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:173) 
     at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75) 
     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: Please correct the above warnings first. 
     at proguard.Initializer.execute(Initializer.java:473) 
     at proguard.ProGuard.initialize(ProGuard.java:233) 
     at proguard.ProGuard.execute(ProGuard.java:98) 
     at com.android.build.gradle.internal.transforms.BaseProguardAction.runProguard(BaseProguardAction.java:52) 
     at com.android.build.gradle.internal.transforms.ProGuardTransform.doMinification(ProGuardTransform.java:273) 
     at com.android.build.gradle.internal.transforms.ProGuardTransform.access$000(ProGuardTransform.java:62) 
     at com.android.build.gradle.internal.transforms.ProGuardTransform$1.run(ProGuardTransform.java:199) 
     at com.android.builder.tasks.Job.runTask(Job.java:51) 
     at com.android.build.gradle.tasks.SimpleWorkQueue$EmptyThreadContext.runTask(SimpleWorkQueue.java:41) 
     at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:223) 


BUILD FAILED 

このGDOCである私は、あなたが取得している警告に基づいて https://docs.google.com/document/d/1YxbOfqaUyHJivYrs1hkHE4Tmmo4xAP8-aJkUJJB8e-k/edit?usp=sharing

おかげ

+3

minifyEnabled偽 proguardFilesが得る '追加:あなたのビルドに残ることが余分な警告に対処すべきですDefaultProguardFile( 'ProGuardの-android.txt')、「ProGuardの-rules.txt'' –

+0

http://stackoverflow.com/questions/33877134/errorexecution-failed-for-task-androidtransformclassesandresourceswithprogua –

+4

@IntelliJAmiya minifyEnabled progaurdが無効になり、偽と私はそれを有効にしたい – Tony

答えて

12

を得たすべての警告が含まれている、私はあなたがライブラリの依存関係を持っていることがわかりJava Runtime(rt.jar)の一部に依存していますが、Androidのランタイム(android.jar)には含まれていないため、ProGuardからの警告が表示されます。

あなたのアプリはまだすべてのこれらのコンポーネントが不足して動作する場合、あなたはProGuardの設定ファイル(例えばproguard-project.txt)には、これらを追加してみてくださいすることができますので、これについての警告を表示しないようにProGuardのを設定することができます。

-dontwarn javax.servlet.** 
-dontwarn org.joda.time.** 
-dontwarn org.w3c.dom.** 

この

ProGuardのマニュアル>トラブルシューティング>Warning: can't find referenced class

+2

ありがとうございました。この行を追加することで私の問題を解決しました。-dontwarn jcifs.http.NetworkExplorer – Tony

+0

@Tony – unbekant

関連する問題