简体   繁体   English

LibGDX和RoboVM Maven插件的问题

[英]Issue with LibGDX and RoboVM Maven Plugin

I've been trying to port a libGDX project to iOS, and have encountered a frustrating error. 我一直在尝试将libGDX项目移植到iOS,并且遇到了令人沮丧的错误。 I'm using the RoboVM Maven Plugin , and get the following error when trying to run the iphone simulator. 我正在使用RoboVM Maven插件 ,并且在尝试运行iphone模拟器时出现以下错误。

[ERROR] Failed to execute goal org.robovm:robovm-maven-plugin:0.0.9.1:iphone-sim (iphone-sim) on project Main: Execution iphone-sim of goal org.robovm:robovm-maven-plugin:0.0.9.1:iphone-sim failed: No @Marshaler found for parameter 1 of @Callback method -> [Help 1] [错误]无法在项目Main上执行目标org.robovm:robovm-maven-plugin:0.0.9.1:iphone-sim(iphone-sim):执行目标org.robovm:robovm-maven-plugin:0.0的目标iphone-sim .9.1:iphone-sim失败:@Callback方法的参数1-> [帮助1]找不到@Marshaler

I have little experience with RoboVM, so I have no idea what the error means, much less why it's occurring. 我对RoboVM的经验很少,所以我不知道错误的含义,更不用说为什么发生了。 I've looked around, and nobody else seems to be getting the error in the same context, so I'm at a loss as to what to do. 我环顾四周,似乎没有其他人在相同的上下文中遇到该错误,因此我对如何处理一无所知。

My pom.xml looks like this. 我的pom.xml看起来像这样。

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0      
     http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<artifactId>artifactid</artifactId>
<name>name</name>

<properties>
    <mainClass>main</mainClass>
</properties>

<dependencies>
    <dependency>
        <groupId>com.badlogicgames.gdx</groupId>
        <artifactId>gdx</artifactId>
        <version>0.9.9</version>
    </dependency>

    <dependency>
        <groupId>com.badlogicgames.gdx</groupId>
        <artifactId>gdx-backend-robovm</artifactId>
        <version>0.9.9</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.robovm</groupId>
            <artifactId>robovm-maven-plugin</artifactId>
            <version>0.0.9.1</version>
            <configuration>
                <config>
                    <mainClass>${mainClass}</mainClass>
                    <os>ios</os>
                    <arch>x86</arch>
                </config>
            </configuration>
            <executions>
                <execution>
                    <id>iphone-sim</id>
                    <phase>integration-test</phase>
                    <goals>
                        <goal>iphone-sim</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>
</project>

The 0.9.9 version of libgdx is way outdated and depends on RoboVM 0.0.6. libgdx的0.9.9版本已经过时,并且取决于RoboVM 0.0.6。 You're using the 0.0.9.1 version of the RoboVM Maven plugin which means you must also use the RoboVM 0.0.9 versions of robovm-rt.jar and robovm-cocoatouch.jar . 您使用的是RoboVM Maven插件的0.0.9.1版本,这意味着您还必须使用robovm-rt.jarrobovm-cocoatouch.jar的RoboVM 0.0.9版本。

The best resolution would be to get a newer version of libgdx but I don't think there is one available in Maven Central. 最好的解决办法是获取新版本的libgdx,但我认为Maven Central中没有可用的版本。 You would probably have to build the libgdx Maven artifacts yourself from source. 您可能必须从源代码自己构建libgdx Maven工件。

Another option that could work would be to exclude the RoboVM artifacts pulled in by the libgdx dependency and then add dependencies for RoboVM 0.0.9. 另一个可行的选择是排除由libgdx依赖项引入的RoboVM工件,然后为RoboVM 0.0.9添加依赖项。 Something like this: 像这样:

<dependency>
  <groupId>com.badlogicgames.gdx</groupId>
  <artifactId>gdx-backend-robovm</artifactId>
  <version>0.9.9</version>
  <exclusions>
    <exclusion>
      <groupId>org.robovm</groupId>
      <artifactId>robovm-rt</artifactId>
    </exclusion>
    <exclusion>
      <groupId>org.robovm</groupId>
      <artifactId>robovm-objc</artifactId>
    </exclusion>
    <exclusion>
      <groupId>org.robovm</groupId>
      <artifactId>robovm-cocoatouch</artifactId>
    </exclusion>
  </exclusions>
</dependency>

<dependency>
  <groupId>org.robovm</groupId>
  <artifactId>robovm-cocoatouch</artifactId>
  <version>0.0.9</version>
</dependency>
<dependency>
  <groupId>org.robovm</groupId>
  <artifactId>robovm-objc</artifactId>
  <version>0.0.9</version>
</dependency>
<dependency>
  <groupId>org.robovm</groupId>
  <artifactId>robovm-rt</artifactId>
  <version>0.0.9</version>
</dependency>

I have no idea whether the 0.9.9 version of libgdx will work properly with the 0.0.9 version of RoboVM. 我不知道0.9.9版的libgdx是否可以与0.0.9版的RoboVM一起正常工作。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM