Hi,
I have compiled OSG for Android, and built and deployed the GLES2 Android example on my Nexus 4. However I’m having trouble loading cow.osg, or any other .osg/.osgt files, to test that it works. I’ve built OSG for Android in the past and had these models working but this time around I’m not able to load any models at all. I get the following warnings from logcat:
01-09 16:46:11.812: E/Osg Viewer(18327): There are 1 models to load
01-09 16:46:11.812: E/Osg Viewer(18327): Loading: /storage/emulated/0/cow.osgt
01-09 16:46:11.812: D/Osg Viewer(18327): FindFileInPath(/storage/emulated/0/cow.osgt): returning /storage/emulated/0/cow.osgt
01-09 16:46:11.812: D/Osg Viewer(18327): itr='/vendor/lib'
01-09 16:46:11.812: D/Osg Viewer(18327): FindFileInPath() : trying /vendor/lib/osgPlugins-3.2.1/osgdb_osg.so ...
01-09 16:46:11.812: D/Osg Viewer(18327): itr='/system/lib'
01-09 16:46:11.812: D/Osg Viewer(18327): FindFileInPath() : trying /system/lib/osgPlugins-3.2.1/osgdb_osg.so ...
01-09 16:46:11.812: D/Osg Viewer(18327): itr='/usr/lib/'
01-09 16:46:11.812: D/Osg Viewer(18327): FindFileInPath() : trying /usr/lib/osgPlugins-3.2.1/osgdb_osg.so ...
01-09 16:46:11.812: D/Osg Viewer(18327): itr='/usr/local/lib/'
01-09 16:46:11.812: D/Osg Viewer(18327): FindFileInPath() : trying /usr/local/lib/osgPlugins-3.2.1/osgdb_osg.so ...
01-09 16:46:11.812: D/Osg Viewer(18327): itr='/vendor/lib'
01-09 16:46:11.812: D/Osg Viewer(18327): FindFileInPath() : trying /vendor/lib/osgdb_osg.so ...
01-09 16:46:11.812: D/Osg Viewer(18327): itr='/system/lib'
01-09 16:46:11.812: D/Osg Viewer(18327): FindFileInPath() : trying /system/lib/osgdb_osg.so ...
01-09 16:46:11.812: D/Osg Viewer(18327): itr='/usr/lib/'
01-09 16:46:11.812: D/Osg Viewer(18327): FindFileInPath() : trying /usr/lib/osgdb_osg.so ...
01-09 16:46:11.812: D/Osg Viewer(18327): itr='/usr/local/lib/'
01-09 16:46:11.812: D/Osg Viewer(18327): FindFileInPath() : trying /usr/local/lib/osgdb_osg.so ...
01-09 16:46:11.812: I/Osg Viewer(18327): Warning: dynamic library 'osgPlugins-3.2.1/osgdb_osg.so' does not exist (or isn't readable):
01-09 16:46:11.812: I/Osg Viewer(18327): dlopen failed: library "osgPlugins-3.2.1/osgdb_osg.so" not found
01-09 16:46:11.812: I/Osg Viewer(18327): DynamicLibrary::failed loading "osgPlugins-3.2.1/osgdb_osg.so"
01-09 16:46:11.812: E/Osg Viewer(18327): Model not loaded
Now I thought I didn’t have to do anything special last time to load an .osg file but I’m wondering what I’ve missed? My Android.mk file just has the standard set OSG_ANDROID_DIR and add path/to/libgnustl_static.a in LOCAL_LDLIBS modifications. I’m working with OSG branch 3.2 on Fedora, with ndk-r9c.
Any help would be greatly appreciated. Thanks,
Nathan
Nathan Collins
Software Engineer
________________________________
Have you downloaded your FREE copy of
FieldMove Clino?
Find out more about our app for iPhone and Android smartphones:
http://news.mve.com/fieldmoveclino
Midland Valley Exploration Ltd.
144 West George Street
Glasgow G2 2HG
United Kingdom
Tel: +44 (0) 141 332 2681
Fax: +44 (0) 141 332 6792
The structural geology experts
_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Hi Jordi,
I encounter the same problem in the same situation. I've build OSG for
Android in static mode (only way it even compiles), all static libraries
(for me: .a-files) are in my local installation folder, together with the
libraries for armeabi and armeabi-v7a from the Android Native Developer Kit.
It compiles fine, I can change the background of the viewer without
problems, but it just doesn't wanna load the models. I get the same logcat
messages as mentioned before (not finding the plugins). I, up until now,
loaded files from the internal HDD of the phone (I am on Nexus 5), but today
also try out the sdcard as source. Are there any suggestions how to solve
the problem ?
At the moment, I follow this approach:
go on the commandline to my workdirectory,
execute "<path-to-ndk>/ndk-build", then go to eclipse,
hit "start" and try out the app.
May that be a cause for problems ?
It load's nothing at all, no matter the size. I tried out cessna.osg and
cow.osg from the sample set, an indoor .wrl-model I have (just one blank
wall, 100MB), a larger 3ds file - all run fine on the desktop but not a
single model loads on mobile. I try it currently out with the Nexus 5 and
the NVIDIA Shield tablet - same results at both.
How do I make sure it uses the ".a"-files (static libraries) ? I just used
the Android.mk that is shipped with the example, added -lgnustl..., as
written in all blogs to the topic, set the OSG_ANDROID_DIR to the location
of the local OSG_Android root install location (the folder with "bin" and
"lib" inside). As ndk-build reports, LOCAL_STATIC_LIBRARIES is not set in
the Android.mk, instead all libraries are referred in LOCAL_LDFLAGS.
How do I make sure it uses the ".a"-files (static libraries) ?
checked - only ".a" files available. No shared objects/dynamic libraries
build, all static.
Hi,
is there still anybody available who has an idea what could be wrong in this
instance ? The problem continues to persist and I don't know enough about
the android wrapping system to fix the problem myself. The problem has to be
in the static libraries, but where ?
_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
> Hi Christian,
> I just compiled OSG for Android and executed the example with the fresh
build for GLES1 without major problems.
> What version of OSG are you running? Does the example shipped with OSG
works for you? Are you compiling using the toolchain?
>
>
>
>
>
> 2015-04-20 10:58 GMT+02:00 Jordi Torres
<jtorresfabra-Re5J...@public.gmane.org>:
> Hi Christian, Jan et al.
> Sorry for not being too active.... Anyway, did you try to compile all with
the last additions from Rafa Gaitán? Now it is possible to compile OSG for
Android with dynamic libraries, take a look
to http://www.openscenegraph.org/index.php/documentation/platform-specifics/android/178-building-openscenegraph-for-android-3-4
.
> Is a must for you to use static libs? You can try the dynamic version,
maybe it solves your problems.
>
> Also we are using osgAndroid ( https://gitorious.org/osgandroid/pages/Home
) maybe it could be helpful.
>
> I'm building now OSG for Android to do some testing.
>
> I hope I can help a bit later.
>
>
>
>
> Do the osgAndroid examples shipped with OSG work for you? If those don't
work neither, then something has changed in OSG and broke it since mid-2013
when I have last compiled the Android version (and when it was working).
>
> J.
>
>
>
>
>
>
>
>
>
> _______________________________________________
Hi to everybody,
it's comforting to see some activity going on. The last days, I was working
on another project, so please excuse my late reply too.
I am using OpenSceneGraph 3.0.1. The GLES1 and GLES2 example shipped with
android are the ones that break (not load data). It's not a must-have for me
to use static linking - if dynamic linking would work, it would be fine for
me too. At the moment, I just like to see some model on my android :-)
I will try out osgAndroid and the 3.0.4 build - let's hope it resolves the
issue. Jordi - which version of the NDK are you using ? I have the r10 NDK
installed. It may be good to know for tracking down the error.
News are about to be reported soon. Best Regards,
Christian
I am using OpenSceneGraph 3.0.1. The GLES1 and GLES2 example shipped with
android are the ones that break (not load data).
It's not a must-have for me
to use static linking - if dynamic linking would work, it would be fine for
me too. At the moment, I just like to see some model on my android :-)
I will try out osgAndroid and the 3.0.4 build - let's hope it resolves the
issue.
Jordi - which version of the NDK are you using ? I have the r10 NDK
installed. It may be good to know for tracking down the error.
News are about to be reported soon. Best Regards,
Christian
_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
> Jordi Torres <jtorresfabra <at> ...> writes:
>
> >
> >
> > Hi Christian,
> > I just compiled OSG for Android and executed the example with the fresh
> build for GLES1 without major problems.
> > What version of OSG are you running? Does the example shipped with OSG
> works for you? Are you compiling using the toolchain?
> >
> >
> >
> >
> >
> > 2015-04-20 10:58 GMT+02:00 Jordi Torres
> <jtorresfabra@...>:
> > Hi Christian, Jan et al.
> > Sorry for not being too active.... Anyway, did you try to compile all with
> the last additions from Rafa Gaitán? Now it is possible to compile OSG for
> Android with dynamic libraries, take a look
>
to http://www.openscenegraph.org/index.php/documentation/platform-specifics/android/178-building-openscenegraph-for-android-3-4
> .
> > Is a must for you to use static libs? You can try the dynamic version,
> maybe it solves your problems.
> >
> > Also we are using osgAndroid ( https://gitorious.org/osgandroid/pages/Home
> ) maybe it could be helpful.
> >
> > I'm building now OSG for Android to do some testing.
> >
> > I hope I can help a bit later.
> >
> >
> >
> >
> > Do the osgAndroid examples shipped with OSG work for you? If those don't
> work neither, then something has changed in OSG and broke it since mid-2013
> when I have last compiled the Android version (and when it was working).
> >
> > J.
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > _______________________________________________
>
> Hi to everybody,
>
> it's comforting to see some activity going on. The last days, I was working
> on another project, so please excuse my late reply too.
>
> I am using OpenSceneGraph 3.0.1. The GLES1 and GLES2 example shipped with
> android are the ones that break (not load data). It's not a must-have for me
> to use static linking - if dynamic linking would work, it would be fine for
> me too. At the moment, I just like to see some model on my android
>
> I will try out osgAndroid and the 3.0.4 build - let's hope it resolves the
> issue. Jordi - which version of the NDK are you using ? I have the r10 NDK
> installed. It may be good to know for tracking down the error.
>
> News are about to be reported soon. Best Regards,
>
> Christian
>
> _______________________________________________
> osg-users mailing list
> osg-users <at> lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
So, I downloaded the 3.3.7 developer version of OpenSceneGraph and ran the
cmake command as given in the link for "Building OpenSceneGraph 3.3.2-3.4.x
for Android" (sth. like it).
After a bit of hassle, it compiled fine.
I also put the 3rdParty folder inside the OSG root folder, but cmake reported
that CURL, Jpeg, Tiff etc. are missing - well, weird, but not urgent for now.
I use the svn version rc2, and compile with OPENGL_PROFILE "GLES2".
Then, I imported the GLES1/2 examples in Eclipse, modified the Android.mk so
to link to the installation folder (btw: still used static libs) and using
gnustl_static, ran ndk-build, and this is the output:
christian@PROMETHEUS:~/workspace/Android/osgViewerGLES1_337$
jni/OsgMainApp.cpp:101: error: undefined reference to
'osgViewer::View::addEventHandler(osgGA::EventHandler*)'
jni/OsgMainApp.cpp:102: error: undefined reference to
'osgViewer::View::addEventHandler(osgGA::EventHandler*)'
jni/OsgMainApp.cpp:103: error: undefined reference to
'osgViewer::View::addEventHandler(osgGA::EventHandler*)'
jni/OsgMainApp.cpp:104: error: undefined reference to
'osgViewer::View::addEventHandler(osgGA::EventHandler*)'
collect2: error: ld returned 1 exit status
make: *** [obj/local/armeabi/libosgNativeLib.so] Error 1
Hence, the static linker does not find the function
osgViewer::View::addEventHandler(...) in the library. This is the GLES1
example. I guess it is no surprise it doesn't find THAT (shouldn't it be
osgViewer::Viewer::addEventHandler ?!), rather the question is where this is
coded ? I assume there must be sth. going on in the DOTOSGWRAPPER of
osgViewer ...
The output for the osgViewerGLES2, configured and setup the same way, looks
as follows:
christian@PROMETHEUS:~/workspace/Android/osgViewer_337$
jni/OsgMainApp.cpp:113: error: undefined reference to
'osgViewer::View::addEventHandler(osgGA::EventHandler*)'
jni/OsgMainApp.cpp:114: error: undefined reference to
'osgViewer::View::addEventHandler(osgGA::EventHandler*)'
jni/OsgMainApp.cpp:115: error: undefined reference to
'osgViewer::View::addEventHandler(osgGA::EventHandler*)'
jni/OsgMainApp.cpp:116: error: undefined reference to
'osgViewer::View::addEventHandler(osgGA::EventHandler*)'
/media/christian/DATA/OpenSceneGraph301/include/osg/State:555: error:
undefined reference to 'glColor4f'
/media/christian/DATA/OpenSceneGraph301/include/osg/State:646: error:
undefined reference to 'glEnableClientState'
/media/christian/DATA/OpenSceneGraph301/include/osg/State:651: error:
undefined reference to 'glVertexPointer'
/media/christian/DATA/OpenSceneGraph301/include/osg/State:859: error:
undefined reference to 'glDisableClientState'
/media/christian/DATA/OpenSceneGraph301/include/osg/State:1062: error:
undefined reference to 'glEnableClientState'
/media/christian/DATA/OpenSceneGraph301/include/osg/State:1066: error:
undefined reference to 'glTexCoordPointer'
/media/christian/DATA/OpenSceneGraph301/include/osg/State:828: error:
undefined reference to 'glEnableClientState'
/media/christian/DATA/OpenSceneGraph301/include/osg/State:833: error:
undefined reference to 'glColorPointer'
/media/christian/DATA/OpenSceneGraph301/include/osg/State:565: error:
undefined reference to 'glNormal3f'
/media/christian/DATA/OpenSceneGraph301/include/osg/State:737: error:
undefined reference to 'glEnableClientState'
/media/christian/DATA/OpenSceneGraph301/include/osg/State:742: error:
undefined reference to 'glNormalPointer'
/media/christian/DATA/OpenSceneGraph301/include/osg/State:859: error:
undefined reference to 'glDisableClientState'
/media/christian/DATA/OpenSceneGraph301/src/osgParticle/Particle.cpp:231:
error: undefined reference to 'glColor4f'
/media/christian/DATA/OpenSceneGraph301/src/osgParticle/Particle.cpp:232:
error: undefined reference to 'glPushMatrix'
/media/christian/DATA/OpenSceneGraph301/src/osgParticle/Particle.cpp:233:
error: undefined reference to 'glTranslatef'
/media/christian/DATA/OpenSceneGraph301/src/osgParticle/Particle.cpp:238:
error: undefined reference to 'glMultMatrixf'
/media/christian/DATA/OpenSceneGraph301/src/osgParticle/Particle.cpp:244:
error: undefined reference to 'glPopMatrix'
[...]
/media/christian/DATA/OpenSceneGraph301/src/osg/ArrayDispatchers.cpp:29:
error: undefined reference to 'glColor4f'
/media/christian/DATA/OpenSceneGraph301/src/osg/ArrayDispatchers.cpp:25:
error: undefined reference to 'glColor4ub'
/media/christian/DATA/OpenSceneGraph301/src/osg/ArrayDispatchers.cpp:34:
error: undefined reference to 'glNormal3f'
/media/christian/DATA/OpenSceneGraph301/src/osg/ArrayDispatchers.cpp:33:
error: undefined reference to 'glNormal3f'
collect2: error: ld returned 1 exit status
make: *** [obj/local/armeabi/libosgNativeLib.so] Error 1
Also there, it doesn't find the osgViewer::View::add..., but he also looks
for the GLES1 fixed functionality pipeline calls that surely don't exist.
The question for the is rather why the GLES2 example (I swear by god, it is
the GLES2 example), asks for GLES1 functions ?!
This is how far I got today. Any help would be highly appreciated. I also
append my cmake-line.
cmake .. -DOSG_BUILD_PLATFORM_ANDROID=ON -DDYNAMIC_OPENTHREADS=OFF
-DDYNAMIC_OPENSCENEGRAPH=OFF -DOSG_GL_DISPLAYLISTS_AVAILABLE=OFF
-DOSG_GL_MATRICES_AVAILABLE=OFF -DOSG_GL_VERTEX_FUNCS_AVAILABLE=OFF
-DOSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE=OFF
-DOSG_GL_FIXED_FUNCTION_AVAILABLE=OFF -DOSG_CPP_EXCEPTIONS_AVAILABLE=OFF
-DOSG_GL1_AVAILABLE=OFF -DOSG_GL2_AVAILABLE=OFF -DOSG_GL3_AVAILABLE=OFF
-DOSG_GLES1_AVAILABLE=OFF -DOSG_GLES2_AVAILABLE=ON
-DCMAKE_INSTALL_PREFIX=$HOME/android_install -DCMAKE_BUILD_TYPE=Release
-DCMAKE_TOOLCHAIN_FILE=/media/christian/DATA/OpenSceneGraph337
/PlatformSpecifics/Android/android.toolchain.cmake
-DOPENGL_PROFILE="GLES2"
Tomorrow, I go and try the osgAndroid repo out.
Best Regards already,
>
>
> Hello Christian,
> Just to clarify a little bit the things:
>
> - All the versions until 3.3.2 (I think that's the last one), should be
compiled using the old system (generating the Android.mk files through cmake)
>
> - Newer version must use the new Toolchain mechanism
>
> Both methods are explained
here: http://www.openscenegraph.org/index.php/documentation/platform-specifics/android
>
>
> Regarding the examples inside OSG, I don't know the current status, as far
as I know Jordi made them work but I usually use osgAndroid. FYI I changed
the repository of osgAndroid to github, seems that gitorious has been
absorbed by gitlab, so I moved it out. The new url
is: https://github.com/corsario/osgAndroid
>
>
> Regarding the thirdparty dependencies with the new Toolchain, you are
right, is something I forgot to add into cmake when I was cleaning it up for
building for Android. I'll try to do it once I had some time.
>
> On the other hand, you must build OSG either GLES1 or GLES2. If you build
it against GLES2 then you need to add your own shaders to see something on
screen, of course the example for GLES2 won't work if OSG was built with
GLES1 and the GLES1 example won't show anything if OSG was compiled with
GLES2, I apologize if this was already clarified :)
>
> Best regards,
> Rafa.
>
>
>
Then how do I use the toolchain file for compiling examples that are
imported in Eclipse ? I don't fully understand the toolchain
mechanism further than basically compiling the libraries
(which went successfull so far).
Then how do I use the toolchain file for compiling examples that are
imported in Eclipse ? I don't fully understand the toolchain
mechanism further than basically compiling the libraries
(which went successfull so far).
I updated from trunk this morning (3.3.8).
Rafa.
cmake .. -DANDROID_NDK=/Users/rgaitan/Projects/android/android-ndk-r10c/ -DCMAKE_TOOLCHAIN_FILE=../PlatformSpecifics/Android/android.toolchain.cmake -DOPENGL_PROFILE="GLES1" -DDYNAMIC_OPENTHREADS=OFF -DDYNAMIC_OPENSCENEGRAPH=OFF -DANDROID_NATIVE_API_LEVEL=15 -DANDROID_ABI=armeabi -DCMAKE_INSTALL_PREFIX=/Users/rgaitan/Projects/OSG/osg-trunk-android-static-gles1-sdk/