web-dev-qa-db-fra.com

Erreur: l'exécution a échoué pour la tâche ': app: transformClassesAndResourcesWithProguardForRelease

J'essaie de signer mon application pour la sortie et elle se construit correctement, mais je veux activer Proguard J'obtiens l'erreur suivante

Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease

mon dossier 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:1.0.1@aar'
    compile 'com.daimajia.androidanimations:library:1.1.3@aar'
    compile 'org.Apache.commons:commons-lang3:3.1'
    compile 'com.lifeofcoding:cacheutilslibrary:1.0.1@aar'
    compile 'com.edmodo:rangebar:1.0.0'

}

et mes fichiers de règles ProGuard

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

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

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

et voici le stacktrace

 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

et ce Gdoc contient tous les avertissements que j'ai reçus https://docs.google.com/document/d/1YxbOfqaUyHJivYrs1hkHE4Tmmo4xAP8-aJkUJJB8e-k/edit?usp=sharing

Merci

9
Antwan

Sur la base des avertissements que vous recevez, je constate que vous avez des dépendances sur des bibliothèques qui dépendent de parties du runtime Java (rt.jar) mais ne font pas partie du runtime d'Android (Android.jar), d'où les avertissements que vous recevez de ProGuard.

Si votre application fonctionne toujours avec tous ces composants manquants, vous pouvez configurer ProGuard pour ne pas vous en avertir, donc dans votre fichier de configuration proguard (par exemple proguard-project.txt), vous pouvez essayer d'ajouter ces éléments:

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

Cela devrait vous aider à répondre à tous les avertissements supplémentaires pouvant rester sur votre build:

Manuel ProGuard> Dépannage> Avertissement: impossible de trouver la classe référencée

17
unbekant