title: IntelliJ IDEA (2020.2): Gradle: The cache entry for initialization script (appears to be corrupted)
body: <p>I am working with Intellij Idea (CE)</p>
  <ul>
  <li>2020.2.3</li>
  </ul>
  <p>And using Gradle 6.7</p>
  <p>I have the following behavior in Mac and Windows</p>
  <p>In the IDE after to had imported the <code>spring-framework</code> project based on <code>Gradle</code> and the latter being configured as follows:</p>
  <p><a href="https://i.stack.imgur.com/HIANx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HIANx.png" alt="enter image description here" /></a></p>
  <p>From above:</p>
  <ul>
  <li><code>gradle user home</code> and <code>gradle home</code> are customs locations</li>
  </ul>
  <p><strong>Note:</strong> the <code>.gradle</code> directory located in the user home is <em>empty</em>.</p>
  <p>Always when I startup the IDE happens the following process:</p>
  <p>The project is loaded:</p>
  <p><a href="https://i.stack.imgur.com/Fmh2U.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Fmh2U.png" alt="enter image description here" /></a></p>
  <p>Immediately and automatically the project is <em>built</em> it (and <em>synchronized</em>) as follows:</p>
  <p><a href="https://i.stack.imgur.com/Uh8xl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Uh8xl.png" alt="enter image description here" /></a></p>
  <p><strong>Note</strong>: I have this situation even applying the following configuration:</p>
  <p><a href="https://i.stack.imgur.com/ypl4y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ypl4y.png" alt="enter image description here" /></a></p>
  <p>it according with the suggestion on:</p>
  <ul>
  <li><a href="https://stackoverflow.com/questions/64806779/intellij-2020-2-how-disable-build-project-automatically-for-a-project-base">IntelliJ (2020.2) - How disable 'Build project automatically' for a project based on Gradle?</a></li>
  </ul>
  <p>Returning to the startup process - the <em>Gradle Daemon</em> runs as follows:</p>
  <p><a href="https://i.stack.imgur.com/4HHDW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4HHDW.png" alt="enter image description here" /></a></p>
  <p>And later of some seconds arises the following error:</p>
  <p><a href="https://i.stack.imgur.com/PmU20.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PmU20.png" alt="enter image description here" /></a></p>
  <p>Practically the same error message for each item.</p>
  <p>One:</p>
  <p><a href="https://i.stack.imgur.com/FXwtA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FXwtA.png" alt="enter image description here" /></a></p>
  <p>Two:</p>
  <p><a href="https://i.stack.imgur.com/LFesw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LFesw.png" alt="enter image description here" /></a></p>
  <p>Until this point the error message is:</p>
  <pre><code>FAILURE: Build failed with an exception.
  
  * What went wrong:
  The cache entry for initialization script 'C:\Users\mjord\AppData\Local\Temp\sync.studio.tooling1.gradle' appears to be corrupted.
  
  * Try:
  Run with --info or --debug option to get more log output. Run with --scan to get full insights.
  
  * Exception is:
  java.lang.IllegalStateException: The cache entry for initialization script 'C:\Users\mjord\AppData\Local\Temp\sync.studio.tooling1.gradle' appears to be corrupted.
      at org.gradle.groovy.scripts.internal.DefaultScriptCompilationHandler$ClassesDirCompiledScript.loadClass(DefaultScriptCompilationHandler.java:343)
      at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.getScript(DefaultScriptRunnerFactory.java:55)
      at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:86)
      at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:111)
      at org.gradle.configuration.BuildOperationScriptPlugin$1.run(BuildOperationScriptPlugin.java:65)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:56)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$run$1(DefaultBuildOperationExecutor.java:71)
      at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.runWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:45)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:71)
      at org.gradle.configuration.BuildOperationScriptPlugin.lambda$apply$0(BuildOperationScriptPlugin.java:62)
      at org.gradle.configuration.internal.DefaultUserCodeApplicationContext.apply(DefaultUserCodeApplicationContext.java:43)
      at org.gradle.configuration.BuildOperationScriptPlugin.apply(BuildOperationScriptPlugin.java:62)
      at org.gradle.configuration.DefaultInitScriptProcessor.process(DefaultInitScriptProcessor.java:50)
      at org.gradle.initialization.InitScriptHandler$1.run(InitScriptHandler.java:56)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:56)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$run$1(DefaultBuildOperationExecutor.java:71)
      at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.runWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:45)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:71)
      at org.gradle.initialization.InitScriptHandler.executeScripts(InitScriptHandler.java:51)
      at org.gradle.initialization.DefaultSettingsPreparer.prepareSettings(DefaultSettingsPreparer.java:33)
      at org.gradle.initialization.BuildOperationFiringSettingsPreparer$LoadBuild.doLoadBuild(BuildOperationFiringSettingsPreparer.java:59)
      at org.gradle.initialization.BuildOperationFiringSettingsPreparer$LoadBuild.run(BuildOperationFiringSettingsPreparer.java:54)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:56)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$run$1(DefaultBuildOperationExecutor.java:71)
      at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.runWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:45)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:71)
      at org.gradle.initialization.BuildOperationFiringSettingsPreparer.prepareSettings(BuildOperationFiringSettingsPreparer.java:42)
      at org.gradle.initialization.DefaultGradleLauncher.prepareSettings(DefaultGradleLauncher.java:220)
      at org.gradle.initialization.DefaultGradleLauncher.doClassicBuildStages(DefaultGradleLauncher.java:161)
      at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:150)
      at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:126)
      at org.gradle.internal.invocation.GradleBuildController$1.create(GradleBuildController.java:72)
      at org.gradle.internal.invocation.GradleBuildController$1.create(GradleBuildController.java:67)
      at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:178)
      at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:67)
      at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:56)
      at org.gradle.tooling.internal.provider.runner.ClientProvidedPhasedActionRunner.run(ClientProvidedPhasedActionRunner.java:60)
      at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
      at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
      at org.gradle.launcher.exec.BuildOutcomeReportingBuildActionRunner.run(BuildOutcomeReportingBuildActionRunner.java:63)
      at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
      at org.gradle.tooling.internal.provider.FileSystemWatchingBuildActionRunner.run(FileSystemWatchingBuildActionRunner.java:67)
      at org.gradle.launcher.exec.BuildCompletionNotifyingBuildActionRunner.run(BuildCompletionNotifyingBuildActionRunner.java:41)
      at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:49)
      at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:44)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
      at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
      at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:44)
      at org.gradle.launcher.exec.InProcessBuildActionExecuter.lambda$execute$0(InProcessBuildActionExecuter.java:54)
      at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:87)
      at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:53)
      at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:29)
      at org.gradle.launcher.exec.BuildTreeScopeLifecycleBuildActionExecuter.lambda$execute$0(BuildTreeScopeLifecycleBuildActionExecuter.java:33)
      at org.gradle.internal.buildtree.BuildTreeState.run(BuildTreeState.java:49)
      at org.gradle.launcher.exec.BuildTreeScopeLifecycleBuildActionExecuter.execute(BuildTreeScopeLifecycleBuildActionExecuter.java:32)
      at org.gradle.launcher.exec.BuildTreeScopeLifecycleBuildActionExecuter.execute(BuildTreeScopeLifecycleBuildActionExecuter.java:27)
      at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:104)
      at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:55)
      at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:64)
      at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:37)
      at org.gradle.tooling.internal.provider.SessionScopeLifecycleBuildActionExecuter.lambda$execute$0(SessionScopeLifecycleBuildActionExecuter.java:54)
      at org.gradle.internal.session.BuildSessionState.run(BuildSessionState.java:67)
      at org.gradle.tooling.internal.provider.SessionScopeLifecycleBuildActionExecuter.execute(SessionScopeLifecycleBuildActionExecuter.java:50)
      at org.gradle.tooling.internal.provider.SessionScopeLifecycleBuildActionExecuter.execute(SessionScopeLifecycleBuildActionExecuter.java:36)
      at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
      at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
      at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:59)
      at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:31)
      at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:55)
      at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:41)
      at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:47)
      at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:31)
      at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:65)
      at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
      at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
      at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:39)
      at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
      at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:29)
      at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
      at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:35)
      at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
      at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:78)
      at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:75)
      at org.gradle.util.Swapper.swap(Swapper.java:38)
      at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:75)
      at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
      at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
      at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
      at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:63)
      at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
      at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
      at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:84)
      at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
      at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
      at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:52)
      at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
      at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
      at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
      at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
  
  
  * Get more help at https://help.gradle.org
  
  BUILD FAILED in 181ms
  </code></pre>
  <p>About the file path:</p>
  <ul>
  <li><code>C:\Users\mjord\AppData\Local\Temp\sync.studio.tooling1.gradle</code></li>
  </ul>
  <p>Really appears two, as follows:</p>
  <p><a href="https://i.stack.imgur.com/Vtlf5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Vtlf5.png" alt="enter image description here" /></a></p>
  <p>Both files have the same content.</p>
  <ul>
  <li>These two files always appears when the IDE is running, if the IDE is closed, they disappear. I am assuming appears two because I have imported (but is closed) the <code>spring-integration</code> project (based on Gradle too)</li>
  </ul>
  <p>But if I do <code>Build</code> -&gt; <code>Build Project</code> as follows</p>
  <p><a href="https://i.stack.imgur.com/TNDyu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TNDyu.png" alt="enter image description here" /></a></p>
  <p>It passes.</p>
  <p><a href="https://i.stack.imgur.com/ls2El.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ls2El.png" alt="enter image description here" /></a></p>
  <p>If I close and open the IDE again, all this situation happens.</p>
  <p><strong>Note</strong>: I read other similar posts in SO, about clear cache (I did do that and nothing) and something about Android (but I don't use Android).</p>
  <p>How solve this? What is missing?</p>
  <h3>Plugins</h3>
  <p>According by Andrey's suggestion</p>
  <p>disabling the Android Plugins: (I don't work with Android)</p>
  <ul>
  <li>Android</li>
  <li>Smali support</li>
  </ul>
  <p><a href="https://i.stack.imgur.com/Itnb2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Itnb2.png" alt="enter image description here" /></a></p>
  <p>and restarting the IDE (is mandatory)</p>
  <p>Now arises:</p>
  <p><a href="https://i.stack.imgur.com/bPZZ6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bPZZ6.png" alt="enter image description here" /></a></p>
  <p>The error is:</p>
  <pre><code>FAILURE: Build failed with an exception.
  
  * What went wrong:
  The cache entry for initialization script 'C:\Users\mjord\AppData\Local\Temp\ijinit.gradle' appears to be corrupted.
  
  * Try:
  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
  
  * Get more help at https://help.gradle.org
  
  BUILD FAILED in 149ms
  </code></pre>
  <p><strong>Observations:</strong></p>
  <ul>
  <li>The files about <code>sync.studio.tooling#.gradle</code> does not appear anymore, therefore they were only generated by Android.</li>
  <li>Now appears other file in the same path: <code>ijinit.gradle</code></li>
  </ul>
  <p>It is the unique created</p>
  <p><a href="https://i.stack.imgur.com/QzlnR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QzlnR.png" alt="enter image description here" /></a></p>
  <p>All was disabled about security to accomplish the suggested instructions.</p>
  <p><a href="https://i.stack.imgur.com/ZvquF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZvquF.png" alt="enter image description here" /></a></p>
  <p>Of course has no sense disable the <code>gradle</code> plugin because is need it by <code>spring-framework</code></p>