当前位置: 动力学知识库 > 问答 > 编程问答 >

RuntimeException: Some file crunching failed on Android gradle

问题描述:

I am having an issue building my Android project with gradle-2.14.1 . The exact error is:

Error:java.lang.RuntimeException: Some file crunching failed, see logs for details

Error:Execution failed for task ':app:mergeInstantrunconfigDebugResources'.

> Error: java.lang.RuntimeException: Some file crunching failed, see logs for details

I searched through stackoverflow and the issue may occur when an image was renamed with the wrong extension. I took a look at my drawables folder and see some of the images were corrupt. Replaced them and I am still getting the same error.

I ran ./gradlew :app:mergeIntegrationDebugResources --debug > buildLog.txt and here's the output.

....

10:57:28.549 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project :app - Transitioning model element 'binaries' to state DefaultsApplied.

10:57:28.550 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project :app - Running model element 'binaries' rule action BinaryBasePlugin.Rules#binaries(BinaryContainer)

10:57:28.550 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project :app - Mutating binaries using BinaryBasePlugin.Rules#binaries(BinaryContainer)

10:57:28.557 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project :app - Transitioning model element 'binaries' to state Initialized.

10:57:28.557 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project :app - Running model element 'bridgedBinaries' rule action JavaBasePlugin.apply()

10:57:28.557 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project :app - Mutating bridgedBinaries using JavaBasePlugin.apply()

10:57:28.557 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project :app - Transitioning model element 'bridgedBinaries' to state Created.

10:57:28.558 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project :app - Transitioning model element 'bridgedBinaries' to state DefaultsApplied.

10:57:28.558 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project :app - Transitioning model element 'bridgedBinaries' to state Initialized.

10:57:28.558 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project :app - Transitioning model element 'bridgedBinaries' to state Mutated.

10:57:28.558 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project :app - Transitioning model element 'bridgedBinaries' to state Finalized.

10:57:28.558 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project :app - Transitioning model element 'bridgedBinaries' to state SelfClosed.

10:57:28.558 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project :app - Transitioning model element 'bridgedBinaries' to state GraphClosed.

10:57:28.558 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project :app - Running model element 'binaries' rule action JavaBasePlugin.Rules#attachBridgedBinaries(BinaryContainer, JavaBasePlugin.BridgedBinaries)

10:57:28.558 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project :app - Mutating binaries using JavaBasePlugin.Rules#attachBridgedBinaries(BinaryContainer, JavaBasePlugin.BridgedBinaries)

10:57:28.559 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project :app - Transitioning model element 'binaries' to state Mutated.

10:57:28.559 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project :app - Transitioning model element 'binaries' to state Finalized.

10:57:28.559 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project :app - Transitioning model element 'binaries' to state SelfClosed.

10:57:28.559 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project :app - Transitioning model element 'binaries' to state GraphClosed.

10:57:28.559 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project :app - Running model element 'tasks' rule action BinaryBasePlugin.Rules#copyBinaryTasksToTaskContainer(TaskContainer, BinaryContainer)

10:57:28.559 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project :app - Mutating tasks using BinaryBasePlugin.Rules#copyBinaryTasksToTaskContainer(TaskContainer, BinaryContainer)

10:57:28.559 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project :app - Transitioning model element 'tasks' to state Mutated.

10:57:28.559 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project :app - Transitioning model element 'tasks' to state Finalized.

10:57:28.560 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project :app - Transitioning model element 'tasks' to state SelfClosed.

10:57:28.560 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project :app - Transitioning model element 'tasks' from state SelfClosed to SelfClosed

10:57:28.576 [LIFECYCLE] [org.gradle.BuildResultLogger]

10:57:28.576 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED

10:57:28.576 [LIFECYCLE] [org.gradle.BuildResultLogger]

10:57:28.576 [LIFECYCLE] [org.gradle.BuildResultLogger] Total time: 12.466 secs

10:57:28.652 [DEBUG] [org.jetbrains.kotlin.gradle.plugin.CleanUpBuildListener] [KOTLIN] Skipping kotlin cleanup since compiler wasn't called

10:57:28.657 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache module-artifacts.bin (C:\Users\carre\.gradle\caches\modules-2\metadata-2.16\module-artifacts.bin)

10:57:28.657 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache module-versions.bin (C:\Users\carre\.gradle\caches\modules-2\metadata-2.16\module-versions.bin)

10:57:28.658 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache artifact-at-repository.bin (C:\Users\carre\.gradle\caches\modules-2\metadata-2.16\artifact-at-repository.bin)

10:57:28.658 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache module-metadata.bin (C:\Users\carre\.gradle\caches\modules-2\metadata-2.16\module-metadata.bin)

10:57:28.658 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on artifact cache (C:\Users\carre\.gradle\caches\modules-2).

10:57:28.659 [DEBUG] [org.gradle.cache.internal.DefaultCacheAccess] Cache Generated Gradle JARs cache (C:\Users\carre\.gradle\caches\2.14.1\generated-gradle-jars) was closed 0 times.

10:57:28.660 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.store.CachedStoreFactory] Resolution result cache closed. Cache reads: 0, disk reads: 0 (avg: 0.0 secs, total: 0.0 secs)

10:57:28.660 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.store.CachedStoreFactory] Resolution result cache closed. Cache reads: 0, disk reads: 8 (avg: 0.001 secs, total: 0.014 secs)

10:57:28.660 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.store.ResolutionResultsStoreFactory] Deleted 2 resolution results binary files in 0.001 secs

10:57:28.661 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.memcache.InMemoryCachedRepositoryFactory] In-memory dependency metadata cache closed. Repos cached: 51, cache instances: 5, modules served from cache: 790, artifacts: 306

10:57:28.661 [DEBUG] [org.gradle.cache.internal.DefaultCacheAccess] Cache Plugin Resolution Cache (C:\Users\carre\.gradle\caches\2.14.1\plugin-resolution) was closed 0 times.

10:57:28.661 [DEBUG] [org.gradle.api.internal.tasks.compile.daemon.CompilerDaemonManager] Stopping 0 compiler daemon(s).

10:57:28.661 [INFO] [org.gradle.api.internal.tasks.compile.daemon.CompilerDaemonManager] Stopped 0 compiler daemon(s).

10:57:28.661 [DEBUG] [org.gradle.launcher.daemon.server.exec.ExecuteBuild] The daemon has finished executing the build.

10:57:28.854 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClientInputForwarder] Dispatching close input message: [email protected]

10:57:28.854 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClientConnection] thread 17: dispatching class org.gradle.launcher.daemon.protocol.CloseInput

10:57:28.856 [INFO] [org.gradle.launcher.daemon.client.DaemonClient] Received result Failure[value=org.gradle.initialization.ReportedException: org.gradle.internal.exceptions.LocationAwareException: Task 'mergeIntegrationDebugResources' not found in project ':app'.] from daemon DaemonInfo{pid=74392, address=[f7c790cc-66ba-4120-aa2e-3a124033e88d port:47413, addresses:[/127.0.0.1, /0:0:0:0:0:0:0:1]], idle=false, lastBusy=1474469837687, context=DefaultDaemonContext[uid=20f3b4f7-83d1-474f-866a-3acdfe8c8c31,javaHome=C:\Program Files\Java\jdk1.8.0_101,daemonRegistryDir=C:\Users\carre\.gradle\daemon,pid=74392,idleTimeout=120000,daemonOpts=-Xmx2560M,-Dfile.encoding=windows-1252,-Duser.country=US,-Duser.language=en,-Duser.variant]} (build should be done).

10:57:28.856 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClientConnection] thread 1: dispatching class org.gradle.launcher.daemon.protocol.Finished

Is there any other issues that would cause this issue? I tried the latest gradle version(3.1) with my project and I am still encountering this issue.

EDIT ----

I rebuilt the project but I am getting the same error. Here is the stacktrace:

:app:generateInstantrunconfigDebugResources UP-TO-DATE

:app:mergeInstantrunconfigDebugResources

AAPT err(Facade for 652320281): libpng error: Read Error

AAPT err(Facade for 2075274027): libpng error: Read Error

AAPT err(Facade for 1565297224): libpng error: Read Error

Error: java.lang.RuntimeException: Some file crunching failed, see logs for deta

:app:mergeInstantrunconfigDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:

Execution failed for task ':app:mergeInstantrunconfigDebugResources'.

> Error: java.lang.RuntimeException: Some file crunching failed, see logs for de

* Try:

Run with --info or --debug option to get more log output.

....

at com.google.common.util.concurrent.AbstractFuture$Sync.getValue(Abstra

at com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFut

at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.j

at com.android.ide.common.res2.MergedResourceWriter.end(MergedResourceWr

... 79 more

Caused by: java.lang.RuntimeException: Some file crunching failed, see logs for

at com.android.builder.png.QueuedCruncher.waitForAll(QueuedCruncher.java

at com.android.builder.png.QueuedCruncher.end(QueuedCruncher.java:303)

at com.android.builder.internal.aapt.v1.AaptV1.lambda$compile$0(AaptV1.j

BUILD FAILED'

网友答案:

try this on terminal inside Android studio with your project directory,

 ./gradlew clean
分享给朋友:
您可能感兴趣的文章:
随机阅读: