Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"loadTexture()"/"loadMesh()" throw NullPointerException (only using Eclipse) #1905

Open
Nathipha opened this issue Jun 14, 2018 · 0 comments
Labels

Comments

@Nathipha
Copy link

Nathipha commented Jun 14, 2018

First of all: I'm still using version 3.0.1 of the framework and I'm aware that you won't be able to fix the problem yourself but I'm wondering if anyone has come across anything similar and has a suggestion what I could try to fix it.

My app loads .obj files (and their textures) at runtime and displays certain ones depending in which direction you're looking. I had to do a couple of changes to deal with a Bundle that's passed from another Android app (non-VR) but I didn't change anything about the way the objects and textures are loaded (didn't even touch anything close to it), still I'm now experiencing a weird problem:

Every time I try to load a texture or .obj file, it throws a NullPointerException:

java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.io.InputStream.markSupported()' on a null object reference

My code for it:

File f1 = new File(path, jpgname);
GVRAndroidResource ar = new GVRAndroidResource(f1);
GVRTexture tex = gvrcontext.loadTexture(ar);
GVRMaterial mat = new GVRMaterial(gvrcontext);
mat.setMainTexture(tex);

GVRSceneObject obj = new GVRSceneObject(gvrcontext);
GVRRenderData render = new GVRRenderData(gvrcontext);
File f2 = new File(path, objname);
GVRMesh mesh = gvrcontext.loadMesh(new GVRAndroidResource(f2));
render.setRenderingOrder(GVRRenderingOrder.TRANSPARENT);
render.setMesh(mesh);

I already checked, "f1", "f2" and "ar" aren't "null", the problem seems to be caused by something in "loadTexture"/"loadMesh".

The actual weird part is: This only happens if I start the app through Eclipse (Run - Run As - Android Application). If I start it by tapping the icon on my phone, everything's working fine - it's loading the same objects and textures without a problem and there are no errors or exceptions.

@liaxim liaxim added the bug label Jul 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants