actuellement, j'utilise Android Studio 2.1 lorsque je lance mon application, une erreur s'est produite dans Message Gradle Build en disant ce qui suit
Information:Gradle tasks [:app:clean, :app:generateDebugSources, :app:prepareDebugUnitTestDependencies, :app:mockableAndroidJar, :app:generateDebugAndroidTestSources, :app:assembleDebug]
:app:clean
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72221Library
:app:prepareComAndroidSupportDesign2221Library
:app:prepareComAndroidSupportSupportV42221Library
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugBuildConfig
:app:mergeDebugShaders
:app:compileDebugShaders
:app:generateDebugAssets
:app:mergeDebugAssets
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources
:app:mergeDebugResources
AAPT err(Facade for 114461397): libpng error: Read Error
*Error:Execution failed for task ':app:mergeDebugResources'.
> Some file crunching failed, see logs for details*
Information:BUILD FAILED
Information:Total time: 24.87 secs
Information:1 error
Information:0 warnings
Information:See complete output in console
J'ai essayé de le nettoyer et de le reconstruire, mais cela n'a pas fonctionné. La réponse pour ceci question n'a pas fonctionné aussi. Toute aide serait appréciée Merci.
Mise à jour: Voici la sortie du journal
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:mergeDebugResources'.
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(PostExecutionAnalysisTaskEx
ecuter.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(SkipEmptySourceFilesTaskExec
uter.Java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.j
ava:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.Java:53)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.j
ava:43)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecute
r.Java:203)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecute
r.Java:185)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecut
or.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(DaemonUsageSuggestingBuildActionExe
cuter.Java:51)
at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExe
cuter.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:23
7)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.Java:21
0)
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)
Caused by: Java.lang.RuntimeException: Some file crunching failed, see logs for details
at com.Android.builder.png.QueuedCruncher.waitForAll(QueuedCruncher.Java:260)
at com.Android.builder.png.QueuedCruncher.end(QueuedCruncher.Java:280)
at com.Android.ide.common.res2.MergedResourceWriter.end(MergedResourceWriter.Java:132)
at com.Android.ide.common.res2.DataMerger.mergeData(DataMerger.Java:295)
at com.Android.ide.common.res2.ResourceMerger.mergeData(ResourceMerger.Java:405)
at com.Android.build.gradle.tasks.MergeResources.doFullTaskAction(MergeResources.Java:178)
at com.Android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.Java:88)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.Java:75)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(A
nnotationProcessingTaskFactory.Java:244)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(Annota
tionProcessingTaskFactory.Java:220)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(Ann
otationProcessingTaskFactory.Java:231)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(Annota
tionProcessingTaskFactory.Java:209)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.j
ava:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.
Java:61)
... 57 more
Dans le build.gradle des applications individuelles, section Android {}
, insérez:
aaptOptions {
cruncherEnabled = false
}
Vérifiez juste ce lien - Android Studio - exception mergeDebugResources et erreur libpng: Il ne s’agit pas d’un fichier PNG Erreur dans Android Studio
Vous pouvez également essayer cette commande Sudo apt-get, installez lib32stdc ++ 6 sur la console si vous travaillez sur une machine Linux, puis redémarrez Android Studio et exécutez votre projet.
En fait, le fichier image a un problème. Allez à (drawable
) et supprimez l’image ou remplacez-la par une nouvelle image. Cela résoudra le problème.
De plus, vous pouvez mettre la méthode dans (build.gradle
), mais cela ne résoudra pas le problème mais un bon moyen de rattraper ce qui ne va pas.
Dans build.gradle
, section Android {}
, insert (cruncherEnagle = false)apptOptions
.
Pour moi, c'était un fichier PNG corrompu. Allez dans votre dossier res
et essayez d’ouvrir toutes les images.
Essayez de lancer gradle à partir de la ligne de commande:
gradle clean build --debug
Et postez votre journal par la suite.
Dans mon dossier res, j'ai créé un fichier 9 PNG. Après la suppression de ce fichier, tout fonctionne correctement.
Pour moi, cette erreur me causait parce que le chemin complet du dossier était plus long que celui autorisé par Windows. J'ai déplacé ma construction sur un chemin moins profond et cette erreur est partie.
Question associée: Android Studio 2.2 Erreur de synchronisation des services Google Play
compressez le fichier de projet et supprimez le projet. et l'extraire et ouvrir