web-dev-qa-db-fra.com

Erreur lors de l'utilisation du compilateur Jack - app/build/intermediates/packaged/debug/classes.Zip 'est une bibliothèque non valide

Je reçois ces erreurs en utilisant le compilateur Jack, mais je ne comprends pas quel est le problème:

Error:Library reading phase: file '/Users/daniele.vitali/Development/Android-studio/INTROCKAND/app/build/intermediates/packaged/debug/classes.Zip' is an invalid library
com.Android.jack.api.v01.CompilationException: Library reading phase: file '/Users/daniele.vitali/Development/Android-studio/INTROCKAND/app/build/intermediates/packaged/debug/classes.Zip' is an invalid library
    at com.Android.jack.api.v01.impl.Api01ConfigImpl$Api01CompilationTaskImpl.run(Api01ConfigImpl.Java:113)
    at com.Android.builder.core.AndroidBuilder.convertByteCodeUsingJackApis(AndroidBuilder.Java:1821)
    at com.Android.builder.core.AndroidBuilder.convertByteCodeUsingJack(AndroidBuilder.Java:1694)
    at com.Android.build.gradle.internal.transforms.JackTransform.runJack(JackTransform.Java:222)
    at com.Android.build.gradle.internal.transforms.JackTransform.transform(JackTransform.Java:196)
    at com.Android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.Java:174)
    at com.Android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.Java:170)
    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:169)
    at Sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at Sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.Java:62)
    at Sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.Java:43)
    at Java.lang.reflect.Method.invoke(Method.Java:498)
    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)
    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.runner.BuildModelActionRunner.run(BuildModelActionRunner.Java:46)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.Java:35)
    at org.gradle.tooling.internal.provider.runner.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.Java:58)
    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.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.Java:52)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.Java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.Java:120)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.Java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.Java:120)
    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.Java:26)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.Java:120)
    at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.Java:34)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.Java:120)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.Java:74)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.Java:72)
    at org.gradle.util.Swapper.swap(Swapper.Java:38)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.Java:72)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.Java:120)
    at org.gradle.launcher.daemon.server.health.DaemonHealthTracker.execute(DaemonHealthTracker.Java:47)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.Java:120)
    at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.Java:66)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.Java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.Java:120)
    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.Java:72)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.Java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.Java:120)
    at org.gradle.launcher.daemon.server.health.HintGCAfterBuild.execute(HintGCAfterBuild.Java:41)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.Java:120)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.Java:50)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.Java:246)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.Java:54)
    at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.Java:40)
    at Java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.Java:1142)
    at Java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.Java:617)
    at Java.lang.Thread.run(Thread.Java:745)
Error:com.Android.jack.JackAbortException: Library reading phase: file '/Users/daniele.vitali/Development/Android-studio/INTROCKAND/app/build/intermediates/packaged/debug/classes.Zip' is an invalid library
    at com.Android.jack.incremental.IncrementalInputFilter.<init>(IncrementalInputFilter.Java:201)
    at Sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at Sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.Java:62)
    at Sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.Java:45)
    at Java.lang.reflect.Constructor.newInstance(Constructor.Java:423)
    at com.Android.sched.util.config.ReflectFactory.create(ReflectFactory.Java:90)
    at com.Android.jack.Jack.buildSession(Jack.Java:846)
    at com.Android.jack.Jack.run(Jack.Java:475)
    at com.Android.jack.api.v01.impl.Api01ConfigImpl$Api01CompilationTaskImpl.run(Api01ConfigImpl.Java:102)
    ... 93 more
Error:com.Android.jack.library.LibraryReadingException: Library reading phase: file '/Users/daniele.vitali/Development/Android-studio/INTROCKAND/app/build/intermediates/packaged/debug/classes.Zip' is an invalid library
    at com.Android.jack.incremental.IncrementalInputFilter.<init>(IncrementalInputFilter.Java:199)
    ... 101 more
Error:com.Android.jack.library.LibraryFormatException: file '/Users/daniele.vitali/Development/Android-studio/INTROCKAND/app/build/intermediates/packaged/debug/classes.Zip' is an invalid library
    ... 102 more
:app:transformJackWithJackForDebug FAILED
Error:Execution failed for task ':app:transformJackWithJackForDebug'.
> com.Android.build.api.transform.TransformException: com.Android.jack.api.v01.CompilationException: Library reading phase: file '/Users/daniele.vitali/Development/Android-studio/INTROCKAND/app/build/intermediates/packaged/debug/classes.Zip' is an invalid library
Information:BUILD FAILED
Information:Total time: 1 mins 53.934 secs
Information:5 errors
Information:0 warnings
Information:See complete output in console

J'utilise Android Studio 2.2 Preview 2 avec les dépendances suivantes:

ext {

    //Android config
    compileSdkVersion = 23
    buildToolsVersion = '24.0.0 rc4'
    minSdkVersion = 16
    targetSdkVersion = 23

    //Libraries
    supportLibrariesVersion = '24.0.0-beta1'
    lombokVersion = '1.16.8'
    guavaVersion = '19.0'
    gsonVersion = '2.6.2'
    butterKnifeVersion = '8.0.1'
    rxAndroidVersion = '1.2.0'
    firebaseVersion = '9.0.1'
    frescoVersion = '0.10.0'
    jUnitVersion = '4.12'
    mockitoVersion = '2.0.54-beta'
    hamcrestVersion = '2.0.0.0'
    daggerVersion = '2.4'
    googlePlayServicesVersion = '9.0.1'
    circularImageViewVersion = '2.0.0'
    bottomBarVersion = '1.3.4'
}

J'utilise aussi le plugin Gradle 2.2.0 alpha 2 et com.google.gms: google-services: 3.0.0

Toute aide est grandement appréciée.

13
Daniele Vitali

Je viens de remarquer le 'AnnotationProcessing' dans votre vidage, cela peut aider si vous ne le faites pas déjà. J'ai dû ajouter annotationProcessor dans les dépendances de Butterknife afin que Jack puisse gérer le traitement des annotations de bibliothèque.

dependencies {
    compile 'com.jakewharton:butterknife:8.0.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.0.1'
}

Il y en aurait un pour poignard aussi ...

dependencies {
    compile 'com.google.dagger:dagger:2.0'
    annotationProcessor 'com.google.dagger:dagger-compiler:2.0'
}

Encore une fois, ce n'est peut-être pas votre problème, mais cela a résolu certains problèmes lorsque j'ai commencé avec Jack hier.

3
mononz

Faire une construction propre du projet a résolu cette erreur pour moi.

0
Vinay Nagaraj

Je me suis engagé à travailler du bon code. Puis, après quelques modifications supplémentaires, j'ai eu cette erreur.

Rien ne fonctionne: annulez, nettoyez, réinitialisez Curent Branch jusqu'à ici ..., reconstruisez, redémarrez ... 

Travaillé pour moi: supprimer le projet et vérifier le projet de VC!

Conclusion: la raison n'est pas dans le code ou build.gradle, peut-être

0

Nous avons eu le même problème dans un projet qui utilise Butter Knife et la spécification de annotationProcessor dans le fichier build.gradle n'a pas aidé.

Nous avons fini par prendre la décision douloureuse de retirer Butter Knife du projet et maintenant, il fonctionne sans problème.

0
Thomas Sunderland