I build this app and tried to move to mobile/native desktop. In mobile and native I have error loading resources from classpath. Error in desktop version:
Caused by: java.lang.NullPointerException
at org.fxapps.alphabet.AlphabetFX.bulkDetailsImages(AlphabetFX.java:178)
It refers to this line: https://github.com/jesuino/alphabetfx/blob/master/alphabetfx/src/main/java/org/fxapps/alphabet/AlphabetFX.java#L178
However, notice I can't also load a single file, it returns null.
Check my projects: https://github.com/jesuino/alphabetfx
I noticed the same error with android app using adb.
Different approaches were tried:
- Used latest version for gluon
- Put everything in the same project
Notice also that it works locally, with Java only. I can't even load the file on root classpath (/details).
I have the same kind of apply of app that works greatly: https://github.com/jesuino/battleship-game
Could this be caused because I have too much assets in my classpath? Or is there some sort of cache? I can see in debug logs that it handles most of my assets.
You can reproduce the error by:
- Build the project using
mvn clean install
- Then go into alphabetfx-app and run
mvn client:build client:package
- Try to run the executable:
./target/client/x86_64-linux/AlphabetFXApp
Please help!
EDIT:
As pointed by Jose in Twitter[1], listing resources from the JAR or native bits (without a FS) won't work, hence I am using a file called "details.txt". However I still get a null when trying to read it. I will continue with this approach and update this with my solution when I find it.
[1] https://twitter.com/JPeredaDnr/status/1323348851345002502