문제

I've been trying to port a libGDX project to iOS, and have encountered a frustrating error. I'm using the RoboVM Maven Plugin, and get the following error when trying to run the iphone simulator.

[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]

I have little experience with RoboVM, so I have no idea what the error means, much less why it's occurring. 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.

<?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. 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.

The best resolution would be to get a newer version of libgdx but I don't think there is one available in Maven Central. You would probably have to build the libgdx Maven artifacts yourself from source.

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. 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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top