Quillraven / SimpleKtxGame

The LibGDX simple game with Kotlin and LibKTX using an assetmanager, pool and viewport
74 stars 14 forks source link

Load Assets failed #11

Closed xqdd closed 5 years ago

xqdd commented 5 years ago
Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load dependencies of asset: music/rain.mp3
    at com.badlogic.gdx.assets.AssetManager.handleTaskError(AssetManager.java:621)
    at com.badlogic.gdx.assets.AssetManager.update(AssetManager.java:411)
    at com.libktx.game.screen.LoadingScreen.render(LoadingScreen.kt:29)
    at ktx.app.KtxGame.render(game.kt:53)
    at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:225)
    at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:126)
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load dependencies of asset: music/rain.mp3
    at com.badlogic.gdx.assets.AssetLoadingTask.handleAsyncLoader(AssetLoadingTask.java:121)
    at com.badlogic.gdx.assets.AssetLoadingTask.update(AssetLoadingTask.java:90)
    at com.badlogic.gdx.assets.AssetManager.updateTask(AssetManager.java:546)
    at com.badlogic.gdx.assets.AssetManager.update(AssetManager.java:409)
    ... 4 more
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: com.badlogic.gdx.utils.GdxRuntimeException: Error creating music com.badlogic.gdx.backends.lwjgl.audio.Mp3$Music for file: music/rain.mp3
    at com.badlogic.gdx.utils.async.AsyncResult.get(AsyncResult.java:46)
    at com.badlogic.gdx.assets.AssetLoadingTask.handleAsyncLoader(AssetLoadingTask.java:119)
    ... 7 more
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Error creating music com.badlogic.gdx.backends.lwjgl.audio.Mp3$Music for file: music/rain.mp3
    at com.badlogic.gdx.backends.lwjgl.audio.OpenALAudio.newMusic(OpenALAudio.java:130)
    at com.badlogic.gdx.backends.lwjgl.audio.OpenALAudio.newMusic(OpenALAudio.java:41)
    at com.badlogic.gdx.assets.loaders.MusicLoader.loadAsync(MusicLoader.java:48)
    at com.badlogic.gdx.assets.loaders.MusicLoader.loadAsync(MusicLoader.java:29)
    at com.badlogic.gdx.assets.AssetLoadingTask.call(AssetLoadingTask.java:70)
    at com.badlogic.gdx.assets.AssetLoadingTask.call(AssetLoadingTask.java:34)
    at com.badlogic.gdx.utils.async.AsyncExecutor$2.call(AsyncExecutor.java:58)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
    at com.badlogic.gdx.backends.lwjgl.audio.OpenALAudio.newMusic(OpenALAudio.java:128)
    ... 10 more
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: File not found: music\rain.mp3 (Internal)
    at com.badlogic.gdx.files.FileHandle.read(FileHandle.java:142)
    at com.badlogic.gdx.backends.lwjgl.audio.Mp3$Music.<init>(Mp3.java:42)
    ... 15 more

image

Quillraven commented 5 years ago

Hi,

did you correctly setup your run configuration? The "project directory" needs to be linked to the assets folder. Did you do that?

Regards Simon

edit: I think it is called working directory. Will check tomorrow for the correct setting but it is mentioned on the libgdx wiki on how to setup a project in IDEA.

Quillraven commented 5 years ago

Yes it is called "Working Directory". Set it to the android/assets folder. I cannot reproduce the issue. Please let me know if you still have problems after setting the correct working directory. Otherwise, I will close the issue.

xqdd commented 5 years ago

Ok, I will check it out when I'm free

xqdd commented 5 years ago

But if you mean this, it doesn't work image

Quillraven commented 5 years ago

I mean the following: image

You need to provide more information if you want help: 1) Which IDE are you using? AS or IntelliJ? 2) Which JDK version are you using (Tried it with JDK8 and JDK11; both work on my site at least)? 3) Which OS do you have? Windows or MasOS?

xqdd commented 5 years ago

Fixed by https://github.com/Quillraven/SimpleKtxGame/pull/12