Dear Jordi Torres,
thank you for your suggestion. I downloaded the SVN version of OpenSceneGraph 
and built it for Android.
Now I am able to run the Example without crash.
However I get some errors and I can't see any rendered 3d model. 

This is the log of the app.

Code:

07-10 23:02:52.770: W/EGLview(14138): creating OpenGL ES 2.0 context
07-10 23:02:52.790: E/OSGANDROID(14138): Initializing geometry
07-10 23:02:52.790: E/Osg Viewer(14138): Testing
07-10 23:02:52.800: W/Osg Viewer(14138): Warning: detected OpenGL error 
'invalid enumerant' at Before Renderer::compile
07-10 23:02:52.830: E/OSGANDROID(14138): Initializing geometry
07-10 23:02:52.830: E/Osg Viewer(14138): Testing
07-10 23:02:52.840: W/Osg Viewer(14138): Warning: detected OpenGL error 
'invalid enumerant' at Before Renderer::compile
07-10 23:08:08.958: W/SurfaceView(14138): CHECK surface infomation 
creating=false formatChanged=false sizeChanged=false visible=false 
visibleChanged=true surfaceChanged=true realSizeChanged=false 
redrawNeeded=false left=false top=false
07-10 23:08:09.278: W/IInputConnectionWrapper(14138): showStatusIcon on 
inactive InputConnection
07-10 23:08:53.751: D/libEGL(15910): loaded /system/lib/egl/libEGL_mali.so
07-10 23:08:53.761: D/libEGL(15910): loaded /system/lib/egl/libGLESv1_CM_mali.so
07-10 23:08:53.761: D/libEGL(15910): loaded /system/lib/egl/libGLESv2_mali.so
07-10 23:08:53.771: W/EGLview(15910): creating OpenGL ES 2.0 context
07-10 23:08:53.781: D/dalvikvm(15910): Trying to load lib 
/data/data/osg.AndroidExample/lib/libosgNativeLib.so 0x41a44740
07-10 23:08:53.901: D/dalvikvm(15910): Added shared lib 
/data/data/osg.AndroidExample/lib/libosgNativeLib.so 0x41a44740
07-10 23:08:53.901: D/dalvikvm(15910): No JNI_OnLoad found in 
/data/data/osg.AndroidExample/lib/libosgNativeLib.so 0x41a44740, skipping init
07-10 23:08:53.911: E/OSGANDROID(15910): Initializing geometry
07-10 23:08:53.911: E/Osg Viewer(15910): Testing
07-10 23:08:53.921: W/Osg Viewer(15910): Warning: detected OpenGL error 
'invalid enumerant' at Before Renderer::compile





In attachment you can see a screenshot of the app running on my Galaxy S III 
mini. As you can see from the screenshot there's nothing rendered on the 
screen. The buttons seem to work correctly because when I press them a label on 
the screen appears indicating the status of the button.

What is the problem in your opinion?

Thank you again,

John


Jorge Izquierdo Ciges wrote:
> Osg in Android is not emulator-friendly... and the EGL libraries seem from 
> emulator instead of a proper device.
> 
> 
> 2013/7/8 John Moore < ()>
> 
> > Hi Adun (),
> > I have done as you said. There was no libgnustl_static.a in the 
> > $(OSG_ANDROID_DIR)/obj/local/armeabi-v7a folder, so I copied it from 
> > ANDROID_NDK folder. Specifically I copied it from
> > $ANDROID_NDK/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a folder
> > 
> > 
> > The build-ndk now seems ok, except some warnings that were treated as 
> > errors because of the -Werror flag in the LOCAL_CFLAGS.
> > These are the warnings:
> > 
> > Code:
> > 
> > jni/osgNativeLib.cpp: In function 'void 
> > Java_osg_AndroidExample_osgNativeLib_loadObject(JNIEnv*, jobject, jstring)':
> > jni/osgNativeLib.cpp:78:70: error: converting 'false' to pointer type for 
> > argument 2 of 'char const* _JNIEnv::GetStringUTFChars(jstring, jboolean*)' 
> > [-Werror=conversion-null]
> > jni/osgNativeLib.cpp: In function 'void 
> > Java_osg_AndroidExample_osgNativeLib_loadObject(JNIEnv*, jobject, jstring, 
> > jstring)':
> > jni/osgNativeLib.cpp:87:70: error: converting 'false' to pointer type for 
> > argument 2 of 'char const* _JNIEnv::GetStringUTFChars(jstring, jboolean*)' 
> > [-Werror=conversion-null]
> > jni/osgNativeLib.cpp:88:64: error: converting 'false' to pointer type for 
> > argument 2 of 'char const* _JNIEnv::GetStringUTFChars(jstring, jboolean*)' 
> > [-Werror=conversion-null]
> > cc1plus: all warnings being treated as errors
> > 
> > 
> > 
> > 
> > I removed the -Werror flag and I was able to successfully complete 
> > ndk-build.
> > 
> > However when I run the app on ADT, it crashes with this output:
> > 
> > Code:
> > 
> > 07-08 17:32:14.799: D/(633): HostConnection::get() New Host Connection 
> > established 0x2a117488, tid 633
> > 07-08 17:32:14.809: D/libEGL(633): loaded 
> > /system/lib/egl/libEGL_emulation.so
> > 07-08 17:32:14.809: D/(633): HostConnection::get() New Host Connection 
> > established 0x2a117530, tid 647
> > 07-08 17:32:14.829: D/libEGL(633): loaded 
> > /system/lib/egl/libGLESv1_CM_emulation.so
> > 07-08 17:32:14.861: D/libEGL(633): loaded 
> > /system/lib/egl/libGLESv2_emulation.so
> > 07-08 17:32:14.899: W/EGLview(633): creating OpenGL ES 2.0 context
> > 07-08 17:32:14.899: W/dalvikvm(633): threadid=11: thread exiting with 
> > uncaught exception (group=0x40a13300)
> > 07-08 17:32:14.909: E/AndroidRuntime(633): FATAL EXCEPTION: GLThread 75
> > 07-08 17:32:14.909: E/AndroidRuntime(633): 
> > java.lang.IllegalArgumentException
> > 07-08 17:32:14.909: E/AndroidRuntime(633):      at 
> > com.google.android.gles_jni.EGLImpl._eglCreateContext(Native Method)
> > 07-08 17:32:14.909: E/AndroidRuntime(633):      at 
> > com.google.android.gles_jni.EGLImpl.eglCreateContext(EGLImpl.java:54)
> > 07-08 17:32:14.909: E/AndroidRuntime(633):      at 
> > osg.AndroidExample.EGLview$ContextFactory.createContext(EGLview.java:103)
> > 07-08 17:32:14.909: E/AndroidRuntime(633):      at 
> > android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:1030)
> > 07-08 17:32:14.909: E/AndroidRuntime(633):      at 
> > android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1401)
> > 07-08 17:32:14.909: E/AndroidRuntime(633):      at 
> > android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
> > 
> > 
> > 
> > 
> > 
> > Do you think the crash is related to the warning?
> > 
> > Thank you for your time,
> > John
> > 
> > ------------------
> > Read this topic online here:
> > 
> > http://forum.openscenegraph.org/viewtopic.php?p=55163#55163 
> > (http://forum.openscenegraph.org/viewtopic.php?p=55163#55163)
> > 
> > 
> > 
> > 
> > 
> > _______________________________________________
> > osg-users mailing list
> >  ()
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org 
> > (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
> > 
> > 
> > 
> 
> 
>  ------------------
> Post generated by Mail2Forum


------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=55197#55197



<<attachment: schermata osgAndroidExample.png>>

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to