4
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] 
StenSoft
  • 9,369
  • 25
  • 30
Bhuvanesh
  • 59
  • 1
  • 1
  • 7
  • 1
    Possible duplicate of [What is a NullPointerException, and how do I fix it?](http://stackoverflow.com/questions/218384/what-is-a-nullpointerexception-and-how-do-i-fix-it) – Jens Aug 26 '16 at 07:43
  • 1
    Could you please edit your question to include more details on what you changed in your project before this error appeared? I'm presently facing the same issue (with the exact same stack trace), and it would both help other to diagnose and me to see if there is any other commonality. @Jens, I don't think this is a duplicate, as I'm actually running into the same issue and it seems to be something wrong in the gradle build process or configuration, not the code itself. – PseudoPsyche Aug 30 '16 at 02:19
  • I had the same issue and this question and answer helped me. So I think the description is good enough for Google to bring me here. Btw, @Bhuvanesh, you could accept the answer below. – ULazdins Sep 02 '16 at 12:27

1 Answers1

12

I ran into this issue after macOS crashed due to a kernel panic during a build of the Android project having this issue. It appears that this is most likely caused by a corrupt gradle cache. You can solve this by doing the following:

  • Close Android Studio
  • Run gradlew --stop to ensure no gradle daemon is still running
  • Delete the .gradle folder at the root of your project
  • Open Android Studio and rebuild

Source: https://code.google.com/p/android/issues/detail?id=220741#c13

PseudoPsyche
  • 4,332
  • 5
  • 37
  • 58