目前我正在使用androidstudio2.1,当我运行我的应用程序时,它显示了gradlebuild中的一些错误消息
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
我试着清理和重建它,但没用。这个问题的答案也不起作用。任何帮助都将不胜感激,谢谢。
更新:这里是日志输出
* 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
13条答案
按热度按时间vcudknz31#
在我的res文件夹中,我创建了一个9png文件。删除此文件后,一切正常。
e7arh2l62#
在单个应用程序的build.gradle部分
android {}
,插入:参考
q9yhzks03#
尝试从命令行运行gradle:
然后把日志贴上去。
ff29svar4#
对我来说,我得到这个错误是因为文件夹的完整路径比windows允许的长。我把我的建筑移到一条较浅的小路上,这个错误就消失了。
相关问题:android studio 2.2 google play服务同步错误
gj3fmq9x5#
关于react native
在项目目录中时,请尝试使用:
$cd android和gradlew清洁
$cd.&&React Native运行android
jmo0nnb36#
我面对同样的问题,检查了所有相关的答案,但我的问题没有解决。我添加了一个新的文件夹,可以在我的应用程序中添加图标。所以在删除那个文件夹后,我的问题就解决了。另外,清理梯度你的问题会得到解决。
cd android && gradlew clean
cd .. && react-native run-android
此外,可能有一些数据已损坏,就像您添加的图像一样,请尝试删除这些图像,这样可能会起作用。nlejzf6q7#
实际上,图像文件出错了。转到(
drawable
)并删除图像或替换为新图像。这将解决问题。此外,您可以将方法(
build.gradle
),但这并不能解决问题,而是弥补错误的好方法。在
build.gradle
,节android {}
,insert (cruncherEnagle = false)apptOptions
.cl25kdpy8#
压缩项目文件并删除prjct。把它取出来打开
uelo1irk9#
只需检查这个链接-androidstudio-mergedebugresources异常和libpng错误:androidstudio中没有显示png文件错误
如果您在linux机器上工作,也可以在控制台上尝试这个命令sudo apt get install lib32stdc++6,然后重新启动android studio并运行您的项目
um6iljoc10#
我也有同样的错误。但现在已经修好了。
主要问题是一些gradle文件已损坏。我已经删除了整个.gradle文件并再次运行该项目。这次成功了!。
当我删除.gradle文件后运行时,它会自动修复gradle文件,如下所示:
登录调试控制台:
rn0zuynd11#
所有的问题是一个崩溃的png图像在我的一个可绘制文件夹。我指的是我们在windows photo viewer中有时会遇到的图像,如下所示:
我从文件夹中删除了图像,所有问题都解决了。
cu6pst1q12#
对我来说,这是一个损坏的png文件。去你的房间
res
文件夹并尝试打开每个图像。cunj1qz113#
浏览项目清单和资源文件,查看您使用的图像中是否有错误(我错过了圆形图标)。
检查您使用的所有图像是否确实存在。