我克隆了 ROS2 Java 示例并尝试使用 Intelij、Gradle 6.3 和 Java 14 使用 Gradle 构建它们。但是在项目导入期间引发了以下异常。我已经完成了 ROS2 的安装,我可以在 cpp 和 python 中成功运行示例。我复制了完整的堆栈跟踪。我电脑中的ROS2版本是ros2-dashing-20200319-windows-amd64。
- 例外情况是:com.intellij.openapi.externalSystem.model.ExternalSystemException:无法在 org.jetbrains 的 org.jetbrains.plugins.gradle.model.ProjectImportAction.addBuildModels(ProjectImportAction.java:272) 的空对象上调用方法 split()。 plugins.gradle.model.ProjectImportAction.execute(ProjectImportAction.java:130) 在 org.jetbrains.plugins.gradle.model.ProjectImportAction.execute(ProjectImportAction.java:56) 在 org.gradle.tooling.internal.consumer.connection。 InternalBuildActionAdapter.execute(InternalBuildActionAdapter.java:79) at org.gradle.tooling.internal.provider.runner.ClientProvidedPhasedActionRunner$ActionRunningListener.runAction(ClientProvidedPhasedActionRunner.java:120) at org.gradle.tooling.internal.provider.runner.ClientProvidedPhasedActionRunner$ ActionRunningListener.run(ClientProvidedPhasedActionRunner.java:110) 在 org.gradle.tooling.internal.provider.runner.ClientProvidedPhasedActionRunner$ActionRunningListener.buildFinished(ClientProvidedPhasedActionRunner.java:104) at jdk.internal.reflect.GeneratedMethodAccessor39.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) 在 org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36) 在 org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) 在 org.gradle。 internal.event.DefaultListenerManager$ListenerDetails.dispatch(DefaultListenerManager.java:382) at org.gradle.internal.event.DefaultListenerManager$ListenerDetails.dispatch(DefaultListenerManager.java:364) at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch( AbstractBroadcastDispatch.java:58) 在 org.gradle.internal.event。DefaultListenerManager$EventBroadcast$ListenerDispatch.dispatch(DefaultListenerManager.java:352) at org.gradle.internal.event.DefaultListenerManager$EventBroadcast$ListenerDispatch.dispatch(DefaultListenerManager.java:339) at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch( AbstractBroadcastDispatch.java:42) at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:231) at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:150) at org .gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:58) 在 org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:325) 在 org.gradle.internal.event.BroadcastDispatch$CompositeDispatch .dispatch(BroadcastDispatch.java:235) 在 org.gradle.internal.event。ListenerBroadcast.dispatch(ListenerBroadcast.java:141) at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:37) at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)在 com.sun.proxy.$Proxy18.buildFinished(Unknown Source) 在 org.gradle.initialization.DefaultGradleLauncher.finishBuild(DefaultGradleLauncher.java:184) 在 org.gradle.initialization.DefaultGradleLauncher.finishBuild(DefaultGradleLauncher.java:127) 在org.gradle.internal.invocation.GradleBuildController$1.create(GradleBuildController.java:67) 在 org.gradle.internal.work.DefaultWorkerLeaseService 的 org.gradle.internal.invocation.GradleBuildController$1.create(GradleBuildController.java:75)。 withLocks(DefaultWorkerLeaseService.java:189) 在 org.gradle.internal.work.StopShieldingWorkerLeaseService。withLocks(StopShieldingWorkerLeaseService.java:40) 在 org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:67) 在 org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:56) 在 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) 在 org.gradle.launcher.exec.BuildOutcomeReportingBuildActionRunner.run(BuildOutcomeReportingBuildActionRunner.java:63) 在 org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32) 在 org. gradle.launcher.exec.BuildCompletionNotifyingBuildActionRunner。在 org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:45) 在 org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.java:51 运行(BuildCompletionNotifyingBuildActionRunner.java:39) .gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416) 在 org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406) 在 org.gradle.internal.operations.DefaultBuildOperationExecutor $1.execute(DefaultBuildOperationExecutor.java:165) 在 org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250) 在 org.gradle.internal.operations。DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158) at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102) at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36) at org .gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:45) 在 org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:50) 在 org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform (InProcessBuildActionExecuter.java:47) 在 org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:80) 在 org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:47) 在 org.gradle。启动器.exec。InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:31) at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:42) at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:28) at org .gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:78) at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:52) at org.gradle.tooling.internal.provider .SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:60) 在 org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:38) 在 org.gradle.tooling.internal.provider.SessionScopeBuildActionExecuter。在 org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:37) 处执行(SessionScopeBuildActionExecuter.java:68)在 org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:26) 在 org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43) 在 org.gradle.tooling.internal .provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29) 在 org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:60) 在 org.gradle.tooling。internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:32) at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:55) at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute( SessionFailureReportingActionExecuter.java:41) 在 org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:48) 在 org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:32) 在 org .gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:68) 在 org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37) 在 org.gradle.launcher .daemon.server.api.DaemonCommandExecution。在 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)在 org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:35) 在 org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104) 在 org.gradle .launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:78) 在 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) 在 org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55) 在 org.gradle.launcher .daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104) 在 org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:63) 在 org.gradle.launcher.daemon.server .exec.BuildCommandOnly.execute(BuildCommandOnly.java:37) 在 org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104) 在 org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment .doBuild(EstablishBuildEnvironment.java:82) 在 org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37) 在 org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution. java:104) 在 org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297) 在 org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:52)在 org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64) 在 org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48) 在 org.gradle.internal.concurrent。 ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56) java.lang.NullPointerException:无法在 org.codehaus.groovy 的空对象上调用方法 split()。runtime.NullObject.invokeMethod(NullObject.java:91) 在 org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:43) 在 org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray. java:47) 在 org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:34) 在 org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47) 在 org.codehaus .groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:52) 在 org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127) 在 org.ros2.tools.gradle.JavaAmentPluginExtension.updateJavaDependencies (JavaAmentPluginExtension.groovy:58) 在 jdk.internal.reflect.GeneratedMethodAccessor81.invoke(Unknown Source) 在 java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl。invoke(DelegatingMethodAccessorImpl.java:43) 在 java.base/java.lang.reflect.Method.invoke(Method.java:564) 在 org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101) 在 groovy .lang.MetaMethod.doMethodInvoke(MetaMethod.java:323) 在 groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1217) 在 org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:94) 在 org. ros2.tools.gradle.JavaAmentPluginExtension.this$dist$invoke$2(JavaAmentPluginExtension.groovy) at org.ros2.tools.gradle.JavaAmentPluginExtension$1.methodMissing(JavaAmentPluginExtension.groovy) at jdk.internal.reflect.GeneratedMethodAccessor80.invoke(Unknown Source ) 在 java.base/java.lang.reflect.Method 的 java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)。在 groovy.lang.MetaClassImpl.invokeMissingMethod(MetaClassImpl.java:958) 在 groovy.lang.MetaClassImpl.invokePropertyOrMissing 的 org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101) 调用(Method.java:564) (MetaClassImpl.java:1286) 在 org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:64) 在 org.codehaus.groovy 的 groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1219)。 runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:160) at org.ros2.tools.gradle.JavaAmentPluginExtension$1.beforeResolve(JavaAmentPluginExtension.groovy:69) at jdk.internal.reflect.GeneratedMethodAccessor79.invoke(Unknown Source) at java .base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 在 java.base/java.lang.reflect.Method.invoke(Method.java:564) 在 org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) 在 org.gradle.internal.event.DefaultListenerManager 的 org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36) $ListenerDetails.dispatch(DefaultListenerManager.java:382) at org.gradle.internal.event.DefaultListenerManager$ListenerDetails.dispatch(DefaultListenerManager.java:364) at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:58 ) 在 org.gradle.internal.event.DefaultListenerManager$EventBroadcast$ListenerDispatch.dispatch(DefaultListenerManager.java:339) 在 org.gradle.internal.event.DefaultListenerManager$EventBroadcast$ListenerDispatch.dispatch(DefaultListenerManager.java:352) 在 org. org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:42)。gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:231) 在 org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:150) 在 org.gradle.internal.event.ListenerBroadcast。 dispatch(ListenerBroadcast.java:141) at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:37) at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94) at com .sun.proxy.$Proxy29.beforeResolve(Unknown Source) at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.performPreResolveActions(DefaultConfiguration.java:674) at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration org.gradle.api.internal.artifacts.configurations 中的 .access$400(DefaultConfiguration.java:141)。DefaultConfiguration$1.run(DefaultConfiguration.java:618) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java :394) 在 org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250) 在 org.gradle.internal.operations 的 org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165) .DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158) 在 org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92) 在 org.gradle.internal.operations.DelegatingBuildOperationExecutor。在 org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.lambda$resolveExclusively 的 org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveGraphIfRequired(DefaultConfiguration.java:611) 运行(DelegatingBuildOperationExecutor.java:31) (DefaultConfiguration.java:592) 在 org.gradle.api.internal.project.DefaultProjectStateRegistry$SafeExclusiveLockImpl.withLock(DefaultProjectStateRegistry.java:289) 在 org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveExclusively(DefaultConfiguration.java :590) 在 org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveToStateOrLater(DefaultConfiguration.java:576) 在 org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getResolvedConfiguration(DefaultConfiguration.java:554) 在org.gradle.api.internal.artifacts。configuration.DefaultConfiguration_Decorated.getResolvedConfiguration(Unknown Source) at org.jetbrains.plugins.gradle.tooling.util.resolve.DependencyResolverImpl.resolveDependencies(DependencyResolverImpl.java:153) at org.jetbrains.plugins.gradle.tooling.util.resolve.DependencyResolverImpl .getDependencies(DependencyResolverImpl.java:537) 在 org.jetbrains.plugins.gradle.tooling.util.resolve.DependencyResolverImpl.resolveDependencies(DependencyResolverImpl.java:131) 在 org.jetbrains.plugins.gradle.tooling.util.DependencyResolver$resolveDependencies .call(Unknown Source) at org.jetbrains.plugins.gradle.tooling.builder.ExternalProjectBuilderImpl$_getSourceSets_closure1.doCall(ExternalProjectBuilderImpl.groovy:440) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect。NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 在 java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 在 java.base/java.lang.reflect.Method.invoke(Method.java:第564章 org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod (ClosureMetaClass.java:263) 在 groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041) 在 groovy.lang.Closure.call(Closure.java:405) 在 groovy.lang.Closure.call(Closure.java: 421)在 org.gradle.util.ClosureBackedAction.execute(ClosureBackedAction.java:71) 在 org.gradle.util.ConfigureUtil.configureTarget(ConfigureUtil.java:154)在 org.gradle.util.ConfigureUtil.configure :105) 在 org.gradle.api.internal.DefaultDomainObjectCollection.all(DefaultDomainObjectCollection.java:163) 在 org.gradle.api.internal.DefaultDomainObjectCollection 的 org.gradle.util.ConfigureUtil$WrappedConfigureAction.execute(ConfigureUtil.java:166) .all(DefaultDomainObjectCollection.java:198) at org.gradle.api.DomainObjectCollection$all$1.call(Unknown Source) at org.jetbrains.plugins.gradle.tooling.builder.ExternalProjectBuilderImpl.getSourceSets(ExternalProjectBuilderImpl.groovy:240) org.jetbrains.plugins.gradle.tooling.builder.ExternalProjectBuilderImpl.doBuild(ExternalProjectBuilderImpl.groovy:101) 在 org.jetbrains.plugins.gradle.tooling.builder.ExternalProjectBuilderImpl.buildAll(ExternalProjectBuilderImpl.groovy:70) 在 org.jetbrains。 plugins.gradle.tooling.internal.ExtraModelBuilder.buildAll(ExtraModelBuilder.java:101) 在 org.gradle。tooling.provider.model.internal.DefaultToolingModelBuilderRegistry$BuildOperationWrappingToolingModelBuilder$1$1.create(DefaultToolingModelBuilderRegistry.java:104) 在 org.gradle.api.internal.project.DefaultProjectStateRegistry.withLenientState(DefaultProjectStateRegistry.java:134) 在 org.gradle.tooling。 provider.model.internal.DefaultToolingModelBuilderRegistry$BuildOperationWrappingToolingModelBuilder$1.call(DefaultToolingModelBuilderRegistry.java:100) at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416) at org.gradle.internal.operations.DefaultBuildOperationExecutor $CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406) 在 .................................... ..................................................... ...... org.gradle.internal。concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56) 在 java.base/java.lang.Thread.run(Thread.java:832)
ros2_java_examples
从命令行构建也失败,但出现不同的错误。
ros2_java_examples\rcljava_examples> gradle build
> Task :checkAmentProperties FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':checkAmentProperties'.
> Missing Ament Gradle property: ament.build_space