1. <tfoot id='Lz91L'></tfoot>
    2. <legend id='Lz91L'><style id='Lz91L'><dir id='Lz91L'><q id='Lz91L'></q></dir></style></legend>

        <i id='Lz91L'><tr id='Lz91L'><dt id='Lz91L'><q id='Lz91L'><span id='Lz91L'><b id='Lz91L'><form id='Lz91L'><ins id='Lz91L'></ins><ul id='Lz91L'></ul><sub id='Lz91L'></sub></form><legend id='Lz91L'></legend><bdo id='Lz91L'><pre id='Lz91L'><center id='Lz91L'></center></pre></bdo></b><th id='Lz91L'></th></span></q></dt></tr></i><div id='Lz91L'><tfoot id='Lz91L'></tfoot><dl id='Lz91L'><fieldset id='Lz91L'></fieldset></dl></div>

      1. <small id='Lz91L'></small><noframes id='Lz91L'>

          <bdo id='Lz91L'></bdo><ul id='Lz91L'></ul>

        com.badlogic.gdx.utils.GdxRuntimeException:无法加载文件

        时间:2023-05-20

        <tfoot id='jFK3S'></tfoot>

          <legend id='jFK3S'><style id='jFK3S'><dir id='jFK3S'><q id='jFK3S'></q></dir></style></legend>
            <tbody id='jFK3S'></tbody>
            <bdo id='jFK3S'></bdo><ul id='jFK3S'></ul>

                <i id='jFK3S'><tr id='jFK3S'><dt id='jFK3S'><q id='jFK3S'><span id='jFK3S'><b id='jFK3S'><form id='jFK3S'><ins id='jFK3S'></ins><ul id='jFK3S'></ul><sub id='jFK3S'></sub></form><legend id='jFK3S'></legend><bdo id='jFK3S'><pre id='jFK3S'><center id='jFK3S'></center></pre></bdo></b><th id='jFK3S'></th></span></q></dt></tr></i><div id='jFK3S'><tfoot id='jFK3S'></tfoot><dl id='jFK3S'><fieldset id='jFK3S'></fieldset></dl></div>
                1. <small id='jFK3S'></small><noframes id='jFK3S'>

                2. 本文介绍了com.badlogic.gdx.utils.GdxRuntimeException:无法加载文件:- 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我正在尝试在 libGDX for iOS 中开发一个应用程序.

                  I am trying to develop an application in libGDX for iOS.

                  在我的 Java 类中我写了这一行

                  In my Java class I have written this line

                  private Texture texture = new Texture(Gdx.files.internal("data/folder_name_1/folder_name_2/abcd.png"));
                  

                  我的 robovm.xml 看起来像这样-

                  and my robovm.xml looks like this-

                  <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)上运行它时.它会生成一个看起来像这样的错误 -

                  When I try to run the code on iOS simulator it runs fine. But when I try to run it on an iOS device i.e. iPhone. It generates an error which looks like this-

                  com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: data/folder_name_1/folder_name_2/abcd.png
                  

                  有人可以帮我解决这个问题吗?

                  Can someone help me with this ?

                  注意:- 在我的 iOS 项目中的 data 文件夹中,还有另一个data"文件夹,其中还有另一个名为folder_name_1"的文件夹,然后在里面我有folder_name_2"文件夹,里面有我的 png 文件'abcd.png'.

                  Note:- in my iOS project in the data folder, there is another 'data' folder in which there is another folder named 'folder_name_1', then inside it I have 'folder_name_2' folder and inside it I have my png file 'abcd.png'.

                  推荐答案

                  错误就在你面前...

                   <directory>../android/assets</directory>
                  

                  您要查找的资源不在数据"文件夹中.它在 android 项目中的资产"中.

                  the resource you are looking for is NOT in the "data" folder. It's in the "Assets" which is in the android project.

                  此外,在加载纹理时,您不需要使用 FileHandler.. 这已经足够了:

                  Also when loading textures you don't need to use a FileHandler.. This would be enough:

                  texture = new Texture("image.png");
                  

                  这将是 android 项目的根(资产)文件夹

                  which would be the root (assets) folder of the android project

                  这篇关于com.badlogic.gdx.utils.GdxRuntimeException:无法加载文件:- 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:让 AdView 工作 下一篇:Libgdx 测验 - 使用 SQLite 数据库?

                  相关文章

                  最新文章

                      <i id='P9AQz'><tr id='P9AQz'><dt id='P9AQz'><q id='P9AQz'><span id='P9AQz'><b id='P9AQz'><form id='P9AQz'><ins id='P9AQz'></ins><ul id='P9AQz'></ul><sub id='P9AQz'></sub></form><legend id='P9AQz'></legend><bdo id='P9AQz'><pre id='P9AQz'><center id='P9AQz'></center></pre></bdo></b><th id='P9AQz'></th></span></q></dt></tr></i><div id='P9AQz'><tfoot id='P9AQz'></tfoot><dl id='P9AQz'><fieldset id='P9AQz'></fieldset></dl></div>

                      <small id='P9AQz'></small><noframes id='P9AQz'>

                        <bdo id='P9AQz'></bdo><ul id='P9AQz'></ul>
                    1. <tfoot id='P9AQz'></tfoot>

                      <legend id='P9AQz'><style id='P9AQz'><dir id='P9AQz'><q id='P9AQz'></q></dir></style></legend>