question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Assets fail to load in a multi-module project

See original GitHub issue

Hi, I run into the following problem when running the demo based on https://github.com/AlmasB/FXGL/wiki/Adding-Images-and-Sounds :

12:03:59.131 [JavaFX Application Thread] FATAL AssetLoader - Loading failed for asset: drop.wav. Cause: Unrecognized file signature! 12:03:59.131 [JavaFX Application Thread] FATAL GameApplication - Uncaught Exception: 12:03:59.132 [JavaFX Application Thread] FATAL GameApplication -

Exception occurred: java.lang.IllegalArgumentException : Failed to load asset: drop.wav. Cause: Unrecognized file signature! E: com.almasb.fxgl.asset.AssetLoader.loadFailed(AssetLoader.kt:652) E: com.almasb.fxgl.asset.AssetLoader.loadSound(AssetLoader.kt:216) E: com.almasb.fxgl.audio.AudioPlayer.playSound(AudioPlayer.kt:114) E: FXGLBasicGameApp.lambda$0(FXGLBasicGameApp.java:103)

Both drop.wav and brick.png won’t load.

In my project, I leave the demo class file within a maven package. The AssetLoader has trouble looking for my resources folder (let alone the textures and sounds within).

I’ve tried using getResource() to get the relative path

String path = this.getClass().getResource("../../assets/textures/brick.png").toExternalForm();

but AssetLoader doesn’t understand it.

Is there a way to load assets from resources in this case ?

Thanks much for any insight and keep up the good work !

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:28 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
mokuncommented, Nov 12, 2017

Thanks for your help in debugging the cause. What a great thing you are doing in improving and putting together the best of all other open source game engines out there !

0reactions
AlmasBcommented, Nov 12, 2017

That’s indeed curious. Anyway, if you think the problem’s been solved feel free to close the issue. Also, let me know how you get on with your project or if you have any other questions

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring-Boot multi module project load property-file
Within my Module1 I want to use a properties file as well (called module1.properties), where the modules configuration is stored. This File will ......
Read more >
Getting Started | Creating a Multi Module Project
This guide shows you how to create a multi-module project with Spring Boot. The project will have a library jar and a main...
Read more >
Multi-Module Project with Maven
A webapp containing user-facing web assets of some sort. Since we'll focus on Maven, the implementation of these services will remain undefined.
Read more >
Use a unique property to set Maven version
When working with a Maven multi-module (dozens of them) project on multiple ... it will fail because ${revision} will not be set in...
Read more >
Creating a multi-module application
Assembling multiple modules into an EAR file. To deploy the entire application on the Open Liberty server, first package the application. Use the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found