Osg in Android is not emulator-friendly... and the EGL libraries seem from emulator instead of a proper device.
2013/7/8 John Moore <kahar...@gmail.com> > 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 > > > > > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org