LibGDX:艺术资产无法加载依赖关系,因为访问被拒绝

时间:2014-01-02 07:03:16

标签: java android libgdx assets

我正在尝试将一些图像加载到AssetManager中,但我的问题是当它们由于依赖性和拒绝访问而无法加载时......我以前从未遇到过这种情况,其他来源也没有非常有帮助。

所有这些都发生在主项目中,而不是Android版本。

奇怪的是,与它相同级别的文件nukeCount.png非常精细且可以使用。

有问题的代码在这里: https://github.com/EyeWumbo/libgdx_device_v1.1/blob/master/Device/src/device/textures/Textures.java

资产目录在这里: https://github.com/EyeWumbo/libgdx_device_v1.1/tree/master/Device

Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load dependencies of asset: data/art/game/UI/uibase/buttons/nuke
at com.badlogic.gdx.assets.AssetManager.handleTaskError(AssetManager.java:517)
at com.badlogic.gdx.assets.AssetManager.update(AssetManager.java:351)
at com.badlogic.gdx.assets.AssetManager.finishLoading(AssetManager.java:372)
at device.textures.Textures.loadArtAssets(Textures.java:104)
at menu.StateManager.moveToGame(StateManager.java:151)
at menu.StateManager.create(StateManager.java:65)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:130)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:110)
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load dependencies of asset: data/art/game/UI/uibase/buttons/nuke
at com.badlogic.gdx.assets.AssetLoadingTask.handleAsyncLoader(AssetLoadingTask.java:119)
at com.badlogic.gdx.assets.AssetLoadingTask.update(AssetLoadingTask.java:89)
at com.badlogic.gdx.assets.AssetManager.updateTask(AssetManager.java:454)
at com.badlogic.gdx.assets.AssetManager.update(AssetManager.java:349)
... 6 more
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: data/art/game/UI/uibase/buttons/nuke
at com.badlogic.gdx.utils.async.AsyncResult.get(AsyncResult.java:46)
at com.badlogic.gdx.assets.AssetLoadingTask.handleAsyncLoader(AssetLoadingTask.java:117)
... 9 more
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: data/art/game/UI/uibase/buttons/nuke
at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:140)
at com.badlogic.gdx.assets.loaders.TextureLoader.loadAsync(TextureLoader.java:72)
at com.badlogic.gdx.assets.loaders.TextureLoader.loadAsync(TextureLoader.java:41)
at com.badlogic.gdx.assets.AssetLoadingTask.call(AssetLoadingTask.java:69)
at com.badlogic.gdx.assets.AssetLoadingTask.call(AssetLoadingTask.java:34)
at com.badlogic.gdx.utils.async.AsyncExecutor$2.call(AsyncExecutor.java:65)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Cannot open a stream to a directory: data\art\game\UI\uibase\buttons\nuke (Internal)
at com.badlogic.gdx.files.FileHandle.read(FileHandle.java:140)
at com.badlogic.gdx.files.FileHandle.readBytes(FileHandle.java:222)
at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:137)
... 9 more
Caused by: java.io.FileNotFoundException: data\art\game\UI\uibase\buttons\nuke (Access is denied)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at com.badlogic.gdx.files.FileHandle.read(FileHandle.java:137)
... 11 more

2 个答案:

答案 0 :(得分:1)

我通过用朋友的资产文件夹中的另一个副本替换资产来“解决”问题。我仍然不知道是什么导致了这个问题...

答案 1 :(得分:0)

你的文件名包含大写字母,如果你应该使用所有字符小写这个问题将解决。因为Android系统得到文件名的小写字符。我希望我能解释清楚。