我试图将RoboVM与libGDX结合使用以运行iOS游戏。我的项目使用maven构建,并使用maven robovm插件在iOS模拟器中测试应用程序。但是,当我尝试运行它时,出现以下错误:
[ERROR] dyld: Library not loaded: @rpath/iPhoneSimulatorRemoteClient.framework/Versions/A/iPhoneSimulatorRemoteClient
[ERROR] Referenced from: /Users/<user>/.m2/repository/org/robovm/robovm-dist/0.0.9/unpacked/robovm-0.0.9/bin/ios-sim
[ERROR] Reason: image not found
我知道这两个问题here和here,但是其中一个从未得到回答,而另一个的答案似乎没有解决我的特定错误。
我正在运行以下maven命令来构建和测试项目:
mvn clean integration-test -Pios
我的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>
<parent>
<groupId>[parent groupid]</groupId>
<artifactId>[parent artifactid]</artifactId>
<version>[parent version]</version>
</parent>
<artifactId>[artifactid]</artifactId>
<packaging>jar</packaging>
<properties>
<mainClass>[Main Class]</mainClass>
</properties>
<dependencies>
<dependency>
<groupId>[core groupid]</groupId>
<artifactId>[core artifactid]</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.badlogicgames.gdx</groupId>
<artifactId>gdx</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.badlogicgames.gdx</groupId>
<artifactId>gdx-backend-robovm</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>../assets</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
<configuration>
<forkMode>once</forkMode>
<argLine>-Djava.library.path=${project.build.directory}/natives/</argLine>
</configuration>
</plugin>
<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>
有谁知道是什么原因导致此错误?我对OS X和RoboVM都不熟悉,所以我完全不知所措。
最佳答案
该问题应该已经在RoboVM 0.0.10中修复。因此,将pom更改为使用RoboVM Maven插件的0.0.10.1版本,看看是否有所作为。