Error:11:25:12.400 [ERROR] [org.gradle.BuildExceptionReporter]
11:25:12.401 [ERROR] [org.gradle.BuildExceptionReporter] **FAILURE: Build failed with an exception.**
11:25:12.401 [ERROR] [org.gradle.BuildExceptionReporter]
11:25:12.401 [ERROR] [org.gradle.BuildExceptionReporter] * **What went wrong:**
11:25:12.401 [ERROR] [org.gradle.BuildExceptionReporter] **java.lang.NullPointerException (no error message)**
11:25:12.401 [ERROR] [org.gradle.BuildExceptionReporter]
11:25:12.401 [ERROR] [org.gradle.BuildExceptionReporter] *** Exception is:**
11:25:12.401 [ERROR] [org.gradle.BuildExceptionReporter] **java.lang.NullPointerException**
11:25:12.401 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.state.TreeSnapshotRepository.removeTreeSnapshotUsage(TreeSnapshotRepository.java:85)
11:25:12.401 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.state.CacheBackedFileSnapshotRepository.remove(CacheBackedFileSnapshotRepository.java:47)
11:25:12.401 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository$1$1.run(CacheBackedTaskHistoryRepository.java:84)
11:25:12.401 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.Factories$1.create(Factories.java:22)
11:25:12.401 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:192)
11:25:12.401 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:175)
11:25:12.401 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirectoryStore.java:106)
11:25:12.401 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheFactory$ReferenceTrackingCache.useCache(DefaultCacheFactory.java:187)
11:25:12.402 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.state.DefaultTaskArtifactStateCacheAccess.useCache(DefaultTaskArtifactStateCacheAccess.java:60)
11:25:12.402 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository$1.update(CacheBackedTaskHistoryRepository.java:66)
11:25:12.402 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.changes.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.afterTask(DefaultTaskArtifactStateRepository.java:135)
11:25:12.402 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:68)
11:25:12.402 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
11:25:12.402 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
11:25:12.402 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
11:25:12.402 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
11:25:12.402 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
11:25:12.402 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
11:25:12.402 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
11:25:12.402 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
11:25:12.402 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
11:25:12.402 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
11:25:12.403 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
11:25:12.403 [ERROR] [org.gradle.BuildExceptionReporter]
答案 0 :(得分:9)
由于在构建具有此问题的Android项目期间内核出现混乱,macOS崩溃后我遇到了这个问题。 看起来这很可能是由损坏的gradle缓存引起的。您可以通过执行以下操作来解决此问题:
gradlew --stop
以确保没有gradle守护程序仍在运行来源:https://code.google.com/p/android/issues/detail?id=220741#c13