eclipse错误导入gradle项目

时间:2017-07-17 12:35:37

标签: java android eclipse gradle eclipse-neon

我有一个Gradle项目,其中包含在setting.gradle文件中定义的子项目。有些项目是android项目,有些则不是。使用Gradle包装器在命令行上构建项目。

导入项目时,我选择了包含build.gradle的根目录。在单击“完成”之前,eclipse在解析Gradle文件后向我展示了预期的项目。

!ENTRY org.eclipse.buildship.core 4 0 2017-07-17 08:32:13.040
!MESSAGE Synchronize Gradle builds with workspace failed due to an unexpected error.
!STACK 0
java.lang.NullPointerException
    at com.gradleware.tooling.toolingmodel.repository.internal.DefaultOmniEclipseProjectDependency.from(DefaultOmniEclipseProjectDependency.java:65)
    at com.gradleware.tooling.toolingmodel.repository.internal.DefaultOmniEclipseProject$1.apply(DefaultOmniEclipseProject.java:286)
    at com.gradleware.tooling.toolingmodel.repository.internal.DefaultOmniEclipseProject$1.apply(DefaultOmniEclipseProject.java:283)
    at com.google.common.collect.Iterators$8.transform(Iterators.java:794)
    at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
    at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:271)
    at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:226)
    at com.google.common.collect.FluentIterable.toList(FluentIterable.java:334)
    at com.gradleware.tooling.toolingmodel.repository.internal.DefaultOmniEclipseProject.toProjectDependencies(DefaultOmniEclipseProject.java:283)
    at com.gradleware.tooling.toolingmodel.repository.internal.DefaultOmniEclipseProject.from(DefaultOmniEclipseProject.java:258)
    at com.gradleware.tooling.toolingmodel.repository.internal.DefaultOmniEclipseProject.from(DefaultOmniEclipseProject.java:275)
    at com.gradleware.tooling.toolingmodel.repository.internal.DefaultOmniEclipseProject.from(DefaultOmniEclipseProject.java:242)
    at com.gradleware.tooling.toolingmodel.repository.internal.DefaultOmniEclipseGradleBuild.from(DefaultOmniEclipseGradleBuild.java:46)
    at com.gradleware.tooling.toolingmodel.repository.internal.DefaultSingleBuildModelRepository$8.apply(DefaultSingleBuildModelRepository.java:181)
    at com.gradleware.tooling.toolingmodel.repository.internal.DefaultSingleBuildModelRepository$8.apply(DefaultSingleBuildModelRepository.java:177)
    at com.gradleware.tooling.toolingmodel.repository.internal.BaseModelRepository.executeAndWait(BaseModelRepository.java:164)
    at com.gradleware.tooling.toolingmodel.repository.internal.BaseModelRepository.access$000(BaseModelRepository.java:41)
    at com.gradleware.tooling.toolingmodel.repository.internal.BaseModelRepository$2.call(BaseModelRepository.java:121)
    at com.google.common.cache.LocalCache$LocalManualCache$1.load(LocalCache.java:4724)
    at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3522)
    at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2315)
    at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2278)
    at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2193)
    at com.google.common.cache.LocalCache.get(LocalCache.java:3932)
    at com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4721)
    at com.gradleware.tooling.toolingmodel.repository.internal.BaseModelRepository.getFromCache(BaseModelRepository.java:138)
    at com.gradleware.tooling.toolingmodel.repository.internal.BaseModelRepository.executeRequest(BaseModelRepository.java:117)
    at com.gradleware.tooling.toolingmodel.repository.internal.BaseModelRepository.executeRequest(BaseModelRepository.java:88)
    at com.gradleware.tooling.toolingmodel.repository.internal.DefaultSingleBuildModelRepository.fetchEclipseGradleBuild(DefaultSingleBuildModelRepository.java:185)
    at org.eclipse.buildship.core.workspace.internal.DefaultModelProvider.fetchEclipseGradleBuild(DefaultModelProvider.java:53)
    at org.eclipse.buildship.core.workspace.internal.SynchronizeGradleBuildsJob.synchronizeBuild(SynchronizeGradleBuildsJob.java:77)
    at org.eclipse.buildship.core.workspace.internal.SynchronizeGradleBuildsJob.runToolingApiJob(SynchronizeGradleBuildsJob.java:69)
    at org.eclipse.buildship.core.util.progress.ToolingApiJob$1.run(ToolingApiJob.java:73)
    at org.eclipse.buildship.core.util.progress.ToolingApiInvoker.invoke(ToolingApiInvoker.java:63)
    at org.eclipse.buildship.core.util.progress.ToolingApiJob.run(ToolingApiJob.java:70)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

注意,由于这个突出问题,Android STudio和IntelliJ对我来说不是IDE选项: https://youtrack.jetbrains.com/issue/IDEA-122904

0 个答案:

没有答案