Search code examples
javaandroidlibgdxassets

LibGDX: Art Assets Couldn't Load Dependencies, because Access Denied


I'm trying to load a few images into an AssetManager, but my problem is that when they can't be loaded because of dependancies and denial of access... I have never encountered this before and other sources aren't very helpful.

All of this is taking place in the main project, not the Android version.

The strange thing is that a file at the same level as it, the nukeCount.png, is perfectly fine and can be used.

The code in question is here: https://github.com/EyeWumbo/libgdx_device_v1.1/blob/master/Device/src/device/textures/Textures.java

And the assets directory is here: 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

Solution

  • I "fixed" the problem by replacing the asset with another copy from a friend's asset folder. I still don't know what caused this issue though...