简体   繁体   English

在目标文件中更改位置后,Tycho 无法解析间接引用的依赖项

[英]After changing location in Target file, Tycho can not resolve indirectly referenced dependency

This might be a duplication of Tycho can't resolve indirectly referenced SWT dependencies , but the given answer does not work for me, so I am not sure.这可能是Tycho can't resolve indirect referenced SWT dependencies的重复,但给定的答案对我不起作用,所以我不确定。


My goal is to update my Target Platform definition file version-by-version from Eclipse Luna to the most recent Eclipse version, which still supports Java 8. But I am stuck in the step from Eclipse 2018-09 to 2018-12 . My goal is to update my Target Platform definition file version-by-version from Eclipse Luna to the most recent Eclipse version, which still supports Java 8. But I am stuck in the step from Eclipse 2018-09 to 2018-12 .

Based on Eclipse 2018-09 I can start my application from Eclipse and I can build it with Tycho 1.7.0.基于 Eclipse 2018-09我可以从 Eclipse 开始我的应用程序,我可以使用 Tycho 1.7.0 构建它。 (Tycho 1.7.0 is also the most current version, which still supports Java 8.) (Tycho 1.7.0也是最新版本,依然支持Java 8。)

The working target file is:工作目标文件是:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
<target name="My Target" sequenceNumber="1622530056">
  <locations>
    <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
      <unit id="org.eclipse.equinox.sdk.feature.group" version="3.15.0.v20180904-1442"/>
      <unit id="org.eclipse.sdk.ide" version="4.9.0.I20180906-0745"/>
      <unit id="org.eclipse.jdt.feature.group" version="3.15.0.v20180906-0745"/>
      <unit id="org.eclipse.e4.tools.compat" version="4.7.200.v20180821-1411"/>
      <unit id="org.eclipse.e4.tools.services" version="4.8.100.v20180821-1411"/>
      <repository id="eclipse-luna" location="http://download.eclipse.org/releases/2018-09"/>
    </location>
  </locations>
</target>

Based on Eclipse 2018-12 I can start my application from Eclipse but I can not build it with Tycho 1.7.0.基于 Eclipse 2018-12我可以从 Eclipse 开始我的应用程序,但我无法使用 Tycho 1.7.0 构建它。

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
<target name="My Target" sequenceNumber="1622530674">
  <locations>
    <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
      <unit id="org.eclipse.equinox.sdk.feature.group" version="3.16.0.v20181130-2106"/>
      <unit id="org.eclipse.sdk.ide" version="4.10.0.I20181206-0815"/>
      <unit id="org.eclipse.jdt.feature.group" version="3.16.0.v20181206-1038"/>
      <unit id="org.eclipse.e4.tools.compat" version="4.7.300.v20181015-0338"/>
      <unit id="org.eclipse.e4.tools.services" version="4.8.200.v20181022-1512"/>
      <repository id="eclipse-luna" location="https://download.eclipse.org/releases/2018-12"/>
    </location>
  </locations>
</target>

The error I get is the following:我得到的错误如下:

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:1.7.0:compile (default-compile) on project com.my_plugin: Compilation failure: Compilation failure: 
[ERROR] C:\path\to\my_project\my_plugin\SomeClass.java: 
[ERROR]     package some.package;
[ERROR]     ^
[ERROR] The type org.eclipse.swt.widgets.Composite cannot be resolved. It is indirectly referenced from required .class files

Things I already tried我已经尝试过的事情

  • I tried to build the project with Tycho 2.3.0 (and Java 11) but I get the indirectly referenced classes error.我尝试使用 Tycho 2.3.0(和 Java 11)构建项目,但我得到了间接引用的类错误。

  • I tried adding jars.extra.classpath = platform:/plugin/org.eclipse.swt.win32.win32.x86_64 as proposed by Tycho can't resolve indirectly referenced SWT dependencies .我尝试按照 Tycho 的建议添加jars.extra.classpath = platform:/plugin/org.eclipse.swt.win32.win32.x86_64 can't resolve indirect referenced SWT dependencies But then I get the following error:但后来我收到以下错误:

[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: com.my_plugin 5.0.0.qualifier
[ERROR]   Missing requirement: com.my_plugin 5.0.0.qualifier requires 'org.eclipse.equinox.p2.iu; org.eclipse.swt.win32.win32.x86_64 0.0.0' but it could not be found
  • According to the Eclipse Help it seems to be platform:/plugins and not platform:/plugin .根据Eclipse 帮助,它似乎是platform:/plugins而不是platform:/plugin But that again leads to to the indirectly referenced classes error.但这又导致了间接引用的类错误。

The origin of the problem was very mundane.问题的根源很普通。 I was still building my project for Windows 32-bit.我仍在为 Windows 32 位构建我的项目。

If I remove如果我删除

<environment>
  <os>win32</os>
  <ws>win32</ws>
  <arch>x86</arch>
</environment>

from my target-platform-configuration the project can be build again.从我的target-platform-configuration中,可以再次构建项目。


I tried to replicate the error with the tycho-example by Vogella and was successful.我试图用 Vogella 的tycho-example复制错误并成功了。

If I put the win32_x86 environment as the first environment I get the following error:如果我将win32_x86环境作为第一个环境,则会收到以下错误:

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:2.3.0:compile (default-compile) on project com.vogella.tycho.p2.ui: Compilation failure: Compilation failure: 
[ERROR] C:\Users\gillesB\git\gilles\tycho-example\bundles\com.vogella.tycho.p2.ui\src\com\vogella\tycho\p2\ui\handlers\UpdateHandler.java:[1] 
[ERROR]     package com.vogella.tycho.p2.ui.handlers;
[ERROR]     ^
[ERROR] The type org.eclipse.swt.widgets.Shell cannot be resolved. It is indirectly referenced from required .class files
[ERROR] C:\Users\gillesB\git\gilles\tycho-example\bundles\com.vogella.tycho.p2.ui\src\com\vogella\tycho\p2\ui\handlers\UpdateHandler.java:[20] 
[ERROR]     import org.eclipse.swt.widgets.Shell;
[ERROR]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] The import org.eclipse.swt.widgets.Shell cannot be resolved
[ERROR] C:\Users\gillesB\git\gilles\tycho-example\bundles\com.vogella.tycho.p2.ui\src\com\vogella\tycho\p2\ui\handlers\UpdateHandler.java:[27] 
[ERROR]     public void execute(final IProvisioningAgent agent, final Shell shell, final UISynchronize sync,
[ERROR]                                                               ^^^^^
[ERROR] Shell cannot be resolved to a type
[ERROR] C:\Users\gillesB\git\gilles\tycho-example\bundles\com.vogella.tycho.p2.ui\src\com\vogella\tycho\p2\ui\handlers\UpdateHandler.java:[38] 
[ERROR]     private IStatus checkForUpdates(final IProvisioningAgent agent, final Shell shell, final UISynchronize sync,
[ERROR]                                                                           ^^^^^
[ERROR] Shell cannot be resolved to a type
[ERROR] C:\Users\gillesB\git\gilles\tycho-example\bundles\com.vogella.tycho.p2.ui\src\com\vogella\tycho\p2\ui\handlers\UpdateHandler.java:[70] 
[ERROR]     private void configureProvisioningJob(ProvisioningJob provisioningJob, final Shell shell, final UISynchronize sync,
[ERROR]                                                                                  ^^^^^
[ERROR] Shell cannot be resolved to a type
[ERROR] C:\Users\gillesB\git\gilles\tycho-example\bundles\com.vogella.tycho.p2.ui\src\com\vogella\tycho\p2\ui\handlers\UpdateHandler.java:[98] 
[ERROR]     private void showMessage(final Shell parent, final UISynchronize sync) {
[ERROR]                                    ^^^^^
[ERROR] Shell cannot be resolved to a type
[ERROR] 6 problems (6 errors)

So the the indirectly referenced classes error also appears.所以间接引用的类错误也会出现。 I built the tycho-example with Windows 10 (64-bit) and Java Corretto 11 (64-bit).我使用 Windows 10(64 位)和 Java Corretto 11(64 位)构建了第tycho-example

If I put the win32_x86 environment as the last environment I get another clearer error message, that a 32-bit dependency can not be found.如果我将win32_x86环境作为最后一个环境,我会收到另一个更清晰的错误消息,即找不到 32 位依赖项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Tycho 无法解析间接引用的 SWT 依赖项 - Tycho can't resolve indirectly referenced SWT dependencies 使用 Tycho 解决对包 sun.misc 的依赖 - Resolve a dependency on package sun.misc with Tycho Eclipse Tycho无法解析正确的依赖关系 - Eclipse Tycho not able to resolve the correct dependency 第谷无法解析片段对其他片段的依赖 - Tycho cannot resolve fragment dependency on other fragment 从所需的.class文件中间接引用 - Indirectly referenced from required .class file 我如何解决错误“第1行:无法解析XX类型。 它是从GWT中所需的.class文件中间接引用的吗? - How can i resolve the error “Line 1: The type XX cannot be resolved. It is indirectly referenced from required .class files” in GWT? 更改函数原型会生成“无法解决。 间接引用”错误 - Changing function prototype generates “cannot be resolved. It is indirectly referenced” error 从 Tycho P2 存储库切换到 Eclipse 目标文件 - Switch from Tycho P2 repository to Eclipse Target file java.nio.file.Path无法解析。 从所需的.class文件间接引用它 - java.nio.file.Path cannot be resolved. It is indirectly referenced from required .class files 从所需的 .class 文件间接引用,即使构建路径设置正确 apache POI ..? - Indirectly referenced from required .class file, even the build path is set correctly apache POI..?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM