【发布时间】:2014-08-05 12:00:22
【问题描述】:
我正在尝试在 libGDX for iOS 中开发一个应用程序。
在我的 Java 类中我写了这一行
private Texture texture = new Texture(Gdx.files.internal("data/folder_name_1/folder_name_2/abcd.png"));
我的 robovm.xml 看起来像这样-
<iosInfoPList>Info.plist.xml</iosInfoPList>
<resources>
<resource>
<directory>../android/assets</directory>
<includes>
<include>**</include>
</includes>
<skipPngCrush>true</skipPngCrush>
</resource>
<resource>
<directory>data</directory>
</resource>
</resources>
当我尝试在 iOS 模拟器上运行代码时,它运行良好。但是当我尝试在 iOS 设备(即 iPhone)上运行它时。它会生成一个看起来像这样的错误 -
com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: data/folder_name_1/folder_name_2/abcd.png
有人可以帮我解决这个问题吗?
注意:- 在我的 iOS 项目中的 data 文件夹中,还有另一个“data”文件夹,其中还有另一个名为“folder_name_1”的文件夹,然后在里面我有“folder_name_2”文件夹,里面有我的 png 文件'abcd.png'。
【问题讨论】:
-
大胆猜测...尝试将
/放在data/...前面。
标签: java ios iphone libgdx robovm