Gradle build fails with Jdk1.7.0_02


(Günther Werner) #1

Hallo,

A multiproject build working fine with Jdk 1.6.0_xx fails after switching to Jdk 1.7.0_02 with the following exception:

14:04:23.182 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception. 14:04:23.182 [ERROR] [org.gradle.BuildExceptionReporter]

14:04:23.182 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong: 14:04:23.182 [ERROR] [org.gradle.BuildExceptionReporter] Could not resolve all dependencies for configuration ‘:np_fwk_database_jdo:compile’. 14:04:23.184 [ERROR] [org.gradle.BuildExceptionReporter] Cause: org.gradle.api.internal.artifacts.dependencies.DefaultProjectDependency_Decorated cannot be cast to org.gradle.api.artifacts.ExternalModuleDependency 14:04:23.184 [ERROR] [org.gradle.BuildExceptionReporter]

14:04:23.184 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is: 14:04:23.184 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.artifacts.ResolveException: Could not resolve all dependencies for configuration ‘:np_fwk_database_jdo:compile’. 14:04:23.185 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDependencyResolver.wrapException(ErrorHandlingArtifactDependencyResolver.java:47) 14:04:23.185 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDependencyResolver.access$000(ErrorHandlingArtifactDependencyResolver.java:26) 14:04:23.185 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDependencyResolver$BrokenResolvedConfiguration.rethrowFailure(ErrorHandlingArtifactDependencyResolver.java:127) 14:04:23.185 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:495) 14:04:23.185 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getFiles(DefaultConfiguration.java:204) 14:04:23.185 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getFiles(Unknown Source) 14:04:23.185 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext$FileTreeConverter.convertInto(DefaultFileCollectionResolveContext.java:187) 14:04:23.185 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.doResolve(DefaultFileCollectionResolveContext.java:102) 14:04:23.185 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.resolveAsFileTrees(DefaultFileCollectionResolveContext.java:74) 14:04:23.185 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext$FileTreeConverter.convertInto(DefaultFileCollectionResolveContext.java:178) 14:04:23.186 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.doResolve(DefaultFileCollectionResolveContext.java:97) 14:04:23.186 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.resolveAsFileTrees(DefaultFileCollectionResolveContext.java:74) 14:04:23.186 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.file.CompositeFileCollection$1.resolve(CompositeFileCollection.java:88) 14:04:23.186 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.file.CompositeFileCollection.getSourceCollections(CompositeFileCollection.java:143) 14:04:23.186 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.file.CompositeFileTree.getSourceCollections(CompositeFileTree.java:30) 14:04:23.186 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.file.CompositeFileCollection.getFiles(CompositeFileCollection.java:38) 14:04:23.186 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.file.AbstractFileCollection.iterator(AbstractFileCollection.java:60) 14:04:23.186 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.DefaultFileSnapshotter.snapshot(DefaultFileSnapshotter.java:42) 14:04:23.186 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.InputFilesChangedUpToDateRule.create(InputFilesChangedUpToDateRule.java:35) 14:04:23.186 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.CompositeUpToDateRule.create(CompositeUpToDateRule.java:35) 14:04:23.186 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateRepository$HistoricExecution.calcCurrentState(DefaultTaskArtifactStateRepository.java:80) 14:04:23.186 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateRepository$HistoricExecution.isUpToDate(DefaultTaskArtifactStateRepository.java:88) 14:04:23.186 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.isUpToDate(DefaultTaskArtifactStateRepository.java:128) 14:04:23.187 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.ShortCircuitTaskArtifactStateRepository$ShortCircuitArtifactState.isUpToDate(ShortCircuitTaskArtifactStateRepository.java:77) 14:04:23.187 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.FileCacheBroadcastTaskArtifactStateRepository$1.isUpToDate(FileCacheBroadcastTaskArtifactStateRepository.java:37) 14:04:23.187 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:44) 14:04:23.187 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:57) 14:04:23.187 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:41) 14:04:23.187 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51) 14:04:23.187 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:52) 14:04:23.187 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:42) 14:04:23.187 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:243) 14:04:23.187 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultTaskGraphExecuter.executeTask(DefaultTaskGraphExecuter.java:192) 14:04:23.187 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultTaskGraphExecuter.doExecute(DefaultTaskGraphExecuter.java:177) 14:04:23.187 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:83) 14:04:23.187 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:36) 14:04:23.187 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:70) 14:04:23.187 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.access$300(DefaultBuildExecuter.java:23) 14:04:23.188 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:80) 14:04:23.188 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32) 14:04:23.188 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:70) 14:04:23.188 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:63) 14:04:23.188 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:157) 14:04:23.188 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:112) 14:04:23.188 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:80) 14:04:23.188 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:42) 14:04:23.188 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:28) 14:04:23.188 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:32) 14:04:23.188 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:21) 14:04:23.188 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$WithLoggingAction.execute(CommandLineActionFactory.java:233) 14:04:23.188 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$WithLoggingAction.execute(CommandLineActionFactory.java:217) 14:04:23.188 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.Main.doAction(Main.java:48) 14:04:23.188 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.EntryPoint$1.execute(EntryPoint.java:53) 14:04:23.189 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.EntryPoint$1.execute(EntryPoint.java:51) 14:04:23.189 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.Execution.execute(Execution.java:28) 14:04:23.189 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.EntryPoint.run(EntryPoint.java:39) 14:04:23.189 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.Main.main(Main.java:39) 14:04:23.189 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.ProcessBootstrap.runNoExit(ProcessBootstrap.java:51) 14:04:23.189 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.ProcessBootstrap.run(ProcessBootstrap.java:33) 14:04:23.189 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.GradleMain.main(GradleMain.java:24) 14:04:23.189 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.ClassCastException: org.gradle.api.internal.artifacts.dependencies.DefaultProjectDependency_Decorated cannot be cast to org.gradle.api.artifacts.ExternalModuleDependency 14:04:23.189 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.artifacts.ivyservice.moduleconverter.dependencies.ExternalModuleDependencyDescriptorFactory.getExternalModuleDependency(ExternalModuleDependencyDescriptorFactory.java:51) 14:04:23.189 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.artifacts.ivyservice.moduleconverter.dependencies.ExternalModuleDependencyDescriptorFactory.createDependencyDescriptor(ExternalModuleDependencyDescriptorFactory.java:39) 14:04:23.189 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.artifacts.ivyservice.moduleconverter.dependencies.AbstractDependencyDescriptorFactoryInternal.addDependencyDescriptor(AbstractDependencyDescriptorFactoryInternal.java:49) 14:04:23.189 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.artifacts.ivyservice.moduleconverter.dependencies.AbstractDependencyDescriptorFactoryInternal.addDependencyDescriptor(AbstractDependencyDescriptorFactoryInternal.java:44) 14:04:23.189 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.artifacts.ivyservice.moduleconverter.dependencies.DefaultDependenciesToModuleDescriptorConverter.addDependencies(DefaultDependenciesToModuleDescriptorConverter.java:48) 14:04:23.189 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.artifacts.ivyservice.moduleconverter.dependencies.DefaultDependenciesToModuleDescriptorConverter.addDependencyDescriptors(DefaultDependenciesToModuleDescriptorConverter.java:41) 14:04:23.189 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.artifacts.ivyservice.moduleconverter.ResolveModuleDescriptorConverter.convert(ResolveModuleDescriptorConverter.java:48) 14:04:23.190 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.artifacts.ivyservice.moduleconverter.PublishModuleDescriptorConverter.convert(PublishModuleDescriptorConverter.java:44) 14:04:23.190 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder.resolve(DependencyGraphBuilder.java:55) 14:04:23.190 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultDependencyResolver.resolve(DefaultDependencyResolver.java:69) 14:04:23.190 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDependencyResolver$1.call(CacheLockingArtifactDependencyResolver.java:37) 14:04:23.190 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDependencyResolver$1.call(CacheLockingArtifactDependencyResolver.java:35) 14:04:23.190 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.artifacts.ivyservice.DefaultCacheLockingManager.withCacheLock(DefaultCacheLockingManager.java:54) 14:04:23.190 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDependencyResolver.resolve(CacheLockingArtifactDependencyResolver.java:35) 14:04:23.190 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.artifacts.ivyservice.SelfResolvingDependencyResolver.resolve(SelfResolvingDependencyResolver.java:42) 14:04:23.190 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.artifacts.ivyservice.ShortcircuitEmptyConfigsArtifactDependencyResolver.resolve(ShortcircuitEmptyConfigsArtifactDependencyResolver.java:78) 14:04:23.190 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.artifacts.ivyservice.EventBroadcastingArtifactDependencyResolver.resolve(EventBroadcastingArtifactDependencyResolver.java:37) 14:04:23.190 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDependencyResolver.resolve(ErrorHandlingArtifactDependencyResolver.java:36) 14:04:23.190 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getResolvedConfiguration(DefaultConfiguration.java:234) 14:04:23.190 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getResolvedConfiguration(Unknown Source) 14:04:23.190 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:493) 14:04:23.190 [ERROR] [org.gradle.BuildExceptionReporter] … 56 more 14:04:23.191 [ERROR] [org.gradle.BuildExceptionReporter]

14:04:23.191 [LIFECYCLE] [org.gradle.BuildResultLogger]

14:04:23.191 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED


(Peter Niederwieser) #2

Not sure if the JDK change is the true cause of the problem. Could you try with the latest m7 snapshot (see recent announcement)?


(Günther Werner) #3

Same error with gradle-1.0-milestone-7-20111220000018+0100. The error happens when Gradle tries to resolve the first project dependency in a multi module java project.

After a quick grep over the sources I suppose that something fails during dynamic code generation in AsmBackedClassGenerator or AsmBackedEmptyScriptGenerator under Jdk 1.7 because there the “_Decorated” is added to type names.


(Peter Niederwieser) #4

It’s normal that _Decorated is added to type names. I just tested with Oracle JDK 1.7.0_01 on Windows and all went fine. I can even build Gradle itself. Will try 1.7.0_02. Which OS and JDK do you use?


(Peter Niederwieser) #5

I get this too, but only when switching around. Do you use the Gradle daemon? This works for me (on Win7):

  1. change JAVA_HOME to JDK 7u1 or 7u2 2. delete projectDir/.gradle 3. delete ~/.gradle/caches (you don’t need to delete sub dirs starting with “artifacts”) 4. run a clean build without daemon

This way I can build Gradle itself with JDK 7u1 and 7u2.


(Günther Werner) #6

Cleaning the gradle directories did the trick. Thanks for the quick response.


(Peter Niederwieser) #7

We should get smarter at invalidating the caches, but for now I’m marking this as solved.


(Mashed Updata) #8

Hi Peter,

I am having almost the same issue as Gunther did but today (26/11/12);

PATH: %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0;C:\Program Files\QuickTime\QTSystem;%JAVA_HOME%\bin

JAVA_HOME: C:\Program Files\Java\jdk1.7.0_09

Windows 7 Professional Patched

Followed the instructions exactly on http://code.google.com/p/android-apktool/wiki/BuildApktool

I followed the instructions above, modified JAVA_HOME to JDK 7u1 and 7u2 => immediate failure.

Changed JAVA_HOME back to what it is not, deleted the .\gradle, the project_dir, .\Apktool etc, start again. Result in Gist below.

git://gist.github.com/4146669.git

Cheers Mashed Updata