HectorGitHub23 / droidar

Automatically exported from code.google.com/p/droidar
0 stars 0 forks source link

ModelLoaderAdapters - crashes when model selected #33

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
---------------------------------------
1. Install ModelLoaderAdapters from Eclipse
2. Select one of the models
3. The AR view starts - click the icon on top-left to cancel accuracy-detection 
- click on prompt to cancel accuracy-detection
4. Red screen with error log appears

What is the expected output? What do you see instead?
---------------------------------------
Expected to see the model (robot, head etc.) - instead I see a red-screen with 
an error

Following is part of the log from Eclipse:

03-18 19:18:16.595: D/ActionWaitForAccuracy(2682): Required accuracy was 
reached!
03-18 19:18:16.675: D/MeshComp(2682): Enabling picking for: Shape 
gl.scenegraph.Shape@40582ac0
03-18 19:18:16.675: V/MeshComp(2682):    > Sending 
(r:0.8023216,g:0.83700716,b:0.3781279,a:1.0) to ColorPicker
03-18 19:18:16.675: V/Object Picker(2682):    > New Color byte[]: {-52, -43, 
96, -1}
03-18 19:18:16.685: V/Object Picker(2682):    > New Color key: -52-4396
03-18 19:18:16.685: V/MeshComp(2682):    > 
myPickColor=(r:0.8023216,g:0.83700716,b:0.3781279,a:1.0)
03-18 19:18:16.685: V/World(2682): Adding worldData.Obj@4056cfa0 to 
worldData.World@4053a448
03-18 19:18:16.705: W/dalvikvm(2682): Exception 
Ljava/lang/UnsatisfiedLinkError; thrown while initializing 
Lcom/badlogic/gdx/backends/android/AndroidApplication;
03-18 19:18:16.705: D/AndroidRuntime(2682): Shutting down VM
03-18 19:18:16.715: W/dalvikvm(2682): threadid=1: thread exiting with uncaught 
exception (group=0x4001d5a0)
03-18 19:18:16.715: E/ErrorHandler(2682): A wild 'Uncaught exeption' appeares!
03-18 19:18:16.715: W/System.err(2682): java.lang.ExceptionInInitializerError
03-18 19:18:16.715: W/System.err(2682):     at 
de.rwth.GDXConnection.<init>(GDXConnection.java:28)
03-18 19:18:16.725: W/System.err(2682):     at 
de.rwth.GDXConnection.init(GDXConnection.java:236)
03-18 19:18:16.725: W/System.err(2682):     at 
de.rwth.ModelLoaderSetup.addObjectsTo(ModelLoaderSetup.java:77)
03-18 19:18:16.725: W/System.err(2682):     at 
system.DefaultARSetup.callAddObjectsToWorldIfNotCalledAlready(DefaultARSetup.jav
a:117)
03-18 19:18:16.725: W/System.err(2682):     at 
system.DefaultARSetup$1.minAccuracyReachedFirstTime(DefaultARSetup.java:106)
03-18 19:18:16.725: W/System.err(2682):     at 
actions.ActionWaitForAccuracy.callFirstTimeAccReachedIfNotYetCalled(ActionWaitFo
rAccuracy.java:98)
03-18 19:18:16.735: W/System.err(2682):     at 
actions.ActionWaitForAccuracy.access$3(ActionWaitForAccuracy.java:94)
03-18 19:18:16.735: W/System.err(2682):     at 
actions.ActionWaitForAccuracy$3.onClick(ActionWaitForAccuracy.java:165)
03-18 19:18:16.735: W/System.err(2682):     at 
android.view.View.performClick(View.java:2533)
03-18 19:18:16.735: W/System.err(2682):     at 
android.view.View$PerformClick.run(View.java:9320)
03-18 19:18:16.735: W/System.err(2682):     at 
android.os.Handler.handleCallback(Handler.java:587)
03-18 19:18:16.735: W/System.err(2682):     at 
android.os.Handler.dispatchMessage(Handler.java:92)
03-18 19:18:16.735: W/System.err(2682):     at 
android.os.Looper.loop(Looper.java:150)
03-18 19:18:16.735: W/System.err(2682):     at 
android.app.ActivityThread.main(ActivityThread.java:4385)
03-18 19:18:16.735: W/System.err(2682):     at 
java.lang.reflect.Method.invokeNative(Native Method)
03-18 19:18:16.735: W/System.err(2682):     at 
java.lang.reflect.Method.invoke(Method.java:507)
03-18 19:18:16.735: W/System.err(2682):     at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849)
03-18 19:18:16.735: W/System.err(2682):     at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:607)
03-18 19:18:16.735: W/System.err(2682):     at 
dalvik.system.NativeStart.main(Native Method)
03-18 19:18:16.745: W/System.err(2682): Caused by: 
java.lang.UnsatisfiedLinkError: Couldn't load gdx: findLibrary returned null
03-18 19:18:16.745: W/System.err(2682):     at 
java.lang.Runtime.loadLibrary(Runtime.java:429)
03-18 19:18:16.745: W/System.err(2682):     at 
java.lang.System.loadLibrary(System.java:554)
03-18 19:18:16.745: W/System.err(2682):     at 
com.badlogic.gdx.utils.GdxNativesLoader.load(GdxNativesLoader.java:116)
03-18 19:18:16.745: W/System.err(2682):     at 
com.badlogic.gdx.backends.android.AndroidApplication.<clinit>(AndroidApplication
.java:59)
03-18 19:18:16.755: W/System.err(2682):     ... 19 more
03-18 19:18:16.755: E/ErrorHandler(2682): Starting error activity
03-18 19:18:16.795: D/dalvikvm(2682): GC_CONCURRENT freed 223K, 45% free 
3118K/5639K, external 28K/512K, paused 3ms+10ms
03-18 19:18:16.795: E/ErrorHandler(2682): Starting from 
system.ArActivity@4053c4a8 to class system.ErrorHandler
03-18 19:18:16.815: D/Process(2682): killProcess, pid=2682
03-18 19:18:16.815: D/Process(2682): 
dalvik.system.VMStack.getThreadStackTrace(Native Method)
03-18 19:18:16.815: D/Process(2682): 
java.lang.Thread.getStackTrace(Thread.java:745)
03-18 19:18:16.815: D/Process(2682): 
android.os.Process.killProcess(Process.java:797)
03-18 19:18:16.815: D/Process(2682): 
system.ErrorHandler.showErrorActivity(ErrorHandler.java:237)
03-18 19:18:16.815: D/Process(2682): 
system.ErrorHandler.uncaughtException(ErrorHandler.java:345)
03-18 19:18:16.815: D/Process(2682): 
java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:854)
03-18 19:18:16.815: D/Process(2682): 
java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:851)
03-18 19:18:16.815: D/Process(2682): dalvik.system.NativeStart.main(Native 
Method)

What version of the product are you using? On what operating system?
-------------------------------------------------------------------
1. Checked out or updated-to-HEAD latest (Mar 18, 2012) versions of:

trunk/droidar/DroidAR
trunk/extensions/model-loaders/model-loaders
trunk/gdx (and all dependent gdx dependecies)

2. Using Eclipse Version: Indigo Service Release 1 - Build id: 20110916-0149

3. HTC Desire HD with Android 2.3.5

4. Windows 7, Java 1.6

Please provide any additional information below.
-------------------------------------------------------------------
Tried the same thing yesterday - but model would not load - only a grey circle 
shape would appear but the model and texture gave a "not found" error - today 
model-loading functionality itself crashed...

Original issue reported on code.google.com by sami....@gmail.com on 18 Mar 2012 at 2:27

GoogleCodeExporter commented 8 years ago
One clarification above (logging this separately too): I commented out Line 17 
in DroidAR/src/gl2/GLSurfaceView.java:

//setEGLContextClientVersion(2);

Because this throws the error: 

Description Resource    Path    Location    Type
The method setEGLContextClientVersion(int) is undefined for the type 
GL2SurfaceView  GL2SurfaceView.java /DroidAR/src/gl2    line 17 Java Problem

Original comment by sami....@gmail.com on 18 Mar 2012 at 3:23

GoogleCodeExporter commented 8 years ago
Solved the undefined setEGLContextClientVersion(2) problem by recompiling with 
Android 3.1 (was using Android 1.6 before)

Recompiled ModelAdapters again as well with Android API 3.1 - crash is still 
there

Original comment by sami....@gmail.com on 18 Mar 2012 at 3:29

GoogleCodeExporter commented 8 years ago
Did you move the resources to the correct folder of your project? You need all 
ressources you want to use in your own project. Compare your project to 
ModelLoaderAdapters, there you can see where they are located

Original comment by simon.heinen on 18 Mar 2012 at 4:52

GoogleCodeExporter commented 8 years ago
I did not create my own project - ran ModelLoaderAdapters directly - as soon as 
I click the "Cancel Accuracy test" icon, this exception appears... any model is 
not loaded at all

Original comment by sami....@gmail.com on 18 Mar 2012 at 4:55

GoogleCodeExporter commented 8 years ago
Ah right i'm sorry I didn't commit the libgdx models with the model loader. you 
will have to copy them from their projects to the ModelLoaderAdapters project 
manually. I didn't want to commit their 3d models to my repository without 
their permission, that's why you have to copy these files manually if you want 
to test it.

Original comment by simon.heinen on 18 Mar 2012 at 5:18

GoogleCodeExporter commented 8 years ago
Thanks - BTW what is the correct location to copy them? <root>/data/assets/ ? 

Original comment by sami....@gmail.com on 19 Mar 2012 at 6:31

GoogleCodeExporter commented 8 years ago
If you don't want to change the code of the ModelLoaderAdapters project just 
create an assets folder in the project folder (ModelLoaderAdapters\assets) and 
put the models in there

Original comment by simon.heinen on 19 Mar 2012 at 8:06

GoogleCodeExporter commented 8 years ago
Well, it turned out libs/armeabi and armeabi-v7 folders were empty - putting 
the requisite library there resolved the crash

I can now see a circular shape (pedestal for demo'ing model?) but cannot load 
the shape itself - I copied robot-mesh.xml and robot.jpg from here:
http://libgdx.googlecode.com/svn/trunk/extensions/model-loaders/model-loaders-an
droid/assets/data/models/ and changed that line in the code

The apk is attached here

this is the output:

03-19 13:50:45.422: D/dalvikvm(19567): No JNI_OnLoad found in 
/data/data/de.rwth/lib/libgdx.so 0x4051d748, skipping init
03-19 13:50:45.422: D/WindowManagerImpl(19567): finishRemoveViewLocked, 
mViews[2]: com.android.internal.policy.impl.PhoneWindow$DecorView@40566c38
03-19 13:50:45.603: D/dalvikvm(19567): GC_CONCURRENT freed 196K, 46% free 
3096K/5639K, external 28K/512K, paused 7ms+40ms
03-19 13:50:45.783: D/ModelCreator(19567): Trying to load robot-mesh.xml
03-19 13:50:45.943: D/dalvikvm(19567): GC_FOR_MALLOC freed 211K, 47% free 
3157K/5895K, external 1K/512K, paused 22ms
03-19 13:50:46.263: I/dalvikvm(19567): Could not find method 
javax.xml.bind.JAXBContext.newInstance, referenced from method 
com.badlogic.gdx.graphics.g3d.loaders.ogre.OgreXmlLoader.loadOgreMesh
03-19 13:50:46.263: W/dalvikvm(19567): VFY: unable to resolve static method 
11217: Ljavax/xml/bind/JAXBContext;.newInstance 
([Ljava/lang/Class;)Ljavax/xml/bind/JAXBContext;
03-19 13:50:46.263: D/dalvikvm(19567): VFY: replacing opcode 0x71 at 0x0008
03-19 13:50:46.263: D/dalvikvm(19567): VFY: dead code 0x000b-0038 in 
Lcom/badlogic/gdx/graphics/g3d/loaders/ogre/OgreXmlLoader;.loadOgreMesh 
(Ljava/io/InputStream;)Lcom/badlogic/gdx/graphics/g3d/loaders/ogre/mesh/Mesh;
03-19 13:50:46.263: I/dalvikvm(19567): Could not find method 
javax.xml.bind.JAXBContext.newInstance, referenced from method 
com.badlogic.gdx.graphics.g3d.loaders.ogre.OgreXmlLoader.loadOgreSkeleton
03-19 13:50:46.263: W/dalvikvm(19567): VFY: unable to resolve static method 
11217: Ljavax/xml/bind/JAXBContext;.newInstance 
([Ljava/lang/Class;)Ljavax/xml/bind/JAXBContext;
03-19 13:50:46.263: D/dalvikvm(19567): VFY: replacing opcode 0x71 at 0x0008
03-19 13:50:46.263: D/dalvikvm(19567): VFY: dead code 0x000b-0038 in 
Lcom/badlogic/gdx/graphics/g3d/loaders/ogre/OgreXmlLoader;.loadOgreSkeleton 
(Ljava/io/InputStream;)Lcom/badlogic/gdx/graphics/g3d/loaders/ogre/skeleton/Skel
eton;
03-19 13:50:46.273: D/szipinf(19567): Initializing inflate state
03-19 13:50:46.273: E/ModelCreator(19567): Could not load model
03-19 13:50:46.273: W/System.err(19567): 
com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file 'robot-mesh.xml'
03-19 13:50:46.273: W/System.err(19567):    at 
com.badlogic.gdx.graphics.g3d.loaders.ogre.OgreXmlLoader.loadMeshes(OgreXmlLoade
r.java:68)
03-19 13:50:46.273: W/System.err(19567):    at 
com.badlogic.gdx.graphics.g3d.loaders.ogre.OgreXmlLoader.load(OgreXmlLoader.java
:88)
03-19 13:50:46.283: W/System.err(19567):    at 
de.rwth.ModelLoader.loadModelFromFile(ModelLoader.java:94)
03-19 13:50:46.283: W/System.err(19567):    at 
de.rwth.ModelLoader.render(ModelLoader.java:126)
03-19 13:50:46.283: W/System.err(19567):    at 
gl.GL1Renderer.onDrawFrame(GL1Renderer.java:107)
03-19 13:50:46.283: W/System.err(19567):    at 
android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1367)
03-19 13:50:46.283: W/System.err(19567):    at 
android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1122)
03-19 13:50:46.283: W/System.err(19567): Caused by: 
com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load meshes
03-19 13:50:46.283: W/System.err(19567):    at 
com.badlogic.gdx.graphics.g3d.loaders.ogre.OgreXmlLoader.loadMesh(OgreXmlLoader.
java:83)
03-19 13:50:46.283: W/System.err(19567):    at 
com.badlogic.gdx.graphics.g3d.loaders.ogre.OgreXmlLoader.loadMeshes(OgreXmlLoade
r.java:66)
03-19 13:50:46.283: W/System.err(19567):    ... 6 more
03-19 13:50:46.283: W/System.err(19567): Caused by: 
java.lang.NoClassDefFoundError: javax.xml.bind.JAXBContext
03-19 13:50:46.283: W/System.err(19567):    at 
com.badlogic.gdx.graphics.g3d.loaders.ogre.OgreXmlLoader.loadOgreMesh(OgreXmlLoa
der.java:347)
03-19 13:50:46.283: W/System.err(19567):    at 
com.badlogic.gdx.graphics.g3d.loaders.ogre.OgreXmlLoader.loadMesh(OgreXmlLoader.
java:79)
03-19 13:50:46.283: W/System.err(19567):    ... 7 more
03-19 13:50:46.283: D/ModelCreator(19567): Result of trying is:
03-19 13:50:46.283: D/ModelCreator(19567): fileName=robot-mesh.xml
03-19 13:50:46.283: D/ModelCreator(19567): textureFileName=robot.jpg
03-19 13:50:46.283: D/ModelCreator(19567): model=null
03-19 13:50:46.283: D/ModelCreator(19567): keyFramedModel=null
03-19 13:50:46.283: D/ModelCreator(19567): skeletonModel=null
03-19 13:50:46.293: D/ModelCreator(19567): 
texture=com.badlogic.gdx.graphics.Texture@40524ae0

Original comment by sami....@gmail.com on 19 Mar 2012 at 8:52

Attachments:

GoogleCodeExporter commented 8 years ago
knight.md2/knight.jpg loaded fine.. 

p.s. there was a typo in assets.txt - fix:

t:assets.txt
i:robot.jpg
b:robot-mesh.xml
i:knight.jpg
b:knight.md2

Original comment by sami....@gmail.com on 19 Mar 2012 at 10:41

GoogleCodeExporter commented 8 years ago
Ok I fixed the missing libs in the armeabi and armeabi-v7 folders, thanks for 
reporting this bug, I think I forgot to commit them.

I always had problems to load all the meshes, I think its a bug in the 
OgreXmlLoader of libgdx. It might also be that some initialization is missing 
from my side, I didn't have the time jet, to find it out. If you find a 
solution to load all model types correctly, let me know.

Original comment by simon.heinen on 19 Mar 2012 at 11:52

GoogleCodeExporter commented 8 years ago
Sure, will do

Original comment by sami....@gmail.com on 19 Mar 2012 at 12:05