Nifty load image prints "java.lang.IllegalArgumentException: Given root path "/textures" not a direc

Hi,

Atm I’m working on my sisters android phone, as mine is broken.

I try to load an xml file with 2 screens. One empty and one containing an image.

When I run my game, then this will be printed:

W/System.err(1948): java.lang.IllegalArgumentException: Given root path “/textures” not a directory

and then something else will throw an exception saying:

java.lang.ClassCastException: com.jme3.asset.AndroidImageInfo



In my project I have an asset folder, like all android projects.

In that folder I have a folder called textures

and in that the image success.png

I’m not sure what to do as the nifty guide says only to give the image name and nifty will find it’s absolute path.



Soo… Whats wrong here?

I guess its because its your sisters phone

Seriously norman, dont answer if you got nothing good to say.

If you have no tangible information don’t post. “something else will throw a class cast exception”. Wtf really, that just screams “you cannot code”. How are we supposed to know how you messed up this time? As always the information you give has nothing to do whatsoever with your issue. “its my sisters phone”, “in my project i have a folder assets”, all totally irrelevant in regard to the error messages. Nifty works asset-wise like the rest of jme3.

I thought it was quite obvious that there is something wrong with the way I load the image in my xml.

Sadly I forgot to add the xml at the end, so I understand if it looks nooby.

Here’s the xml:

[xml]<?xml version=“1.0” encoding=“UTF-8”?>

<nifty>

<screen id=“win” controller=“start.MainClass”>

<layer id=“layer” childLayout=“center”>

<image filename=“success.png”/>

</layer>

</screen>



<screen id=“end”>

</screen>

</nifty>[/xml]

Honestly normen, you don’t have to be an ass about it. Sometimes patience is key if you want the JME to even remotely be popular.



@Addez

Hey, I know this is off topic but I’m creating a framework and will add a lot of functionality to it. Would you be willing to help me test it out?

Its not like I ask him to post proper posts for the first time. And he seemed to want further clarification on my comment which in turn seems to incite you to call me an ass. Whatever, but I still don’t see even remotely how one could help him with this post.

I’v tried to post clearer posts. I even use italic and bold to make it more interesting to read.

I just forgot to add the xml this time, sorry.



As for the framework, what is it for?

Lol, now some nerd suckup to normen thumb me down not even caring what’s it about.

Such a dick. Can I get the name of the one who thumbed down? Or is he to shy to speak?

it was me

It’s like the jmonkey engine but for android. It will have



AndroidHarness()

simpleInitApp()

simpleUpdate()



It will handle all the phone states a whole lot better so that nothing gets destroyed. Better OpenGL 2.0 support and Input handling with native integration. Will try to make a Better UI than Nifty. The word framework just means the base of the engine. I was just asking anyways. You don’t have to. Still working on the framework though.

Your own 3d engine for android?

Sounds interesting, I would like to try that when starting my next game :slight_smile:

Lol, thought you were a good/normal person wez. You disapoint me.

I just wanted to see if I can present better solutions to the JME, I just needed to implement my own engine and use that as the testing ground.

Ahh, a framework to better fit jME3 with android?

Okah, thought u ment writing an engine from scratch :stuck_out_tongue:

Ohwell, I could try that still with my next game. Let me know when your done :slight_smile:

Actually I am writing a game engine from scratch.

Without using jme?

Sounds very fun :slight_smile:

Could I contribute if I were to use it later?

The only contribution is by testing the engine itself. I’ll send you a private message when i’m done.

To get back to your problem, I’m guessing you already tried using a path relative to your assets folder?

If I understand your structure, that’d be filename=“textures/success.png”.

You’d probably get more help if you posted your full stacktrace.

Btw, where do you specify the “/textures” directory? It almost looks like you’ve specified it relative to the root (a starting / usually means relative to root).

Apparently this problem is related to this line:

[java]rootNode.attachChild(SkyFactory.createSky(assetManager, “assets/textures/skybox.png”, false));[/java]

The error message is quite useless as it will only lead to the OGELshaderrenderer or something. But the problem is

when trying to create a skybox. Just giving the texture name without the path will also fail.



I’ll just bypass this by a mesh.

Thanks for trying to help tumaini and tech.

To the rest: Haters gonna hate, my work continues unaffected.