[osg-users] Android osgPlugins
Jan Ciger
jan.ciger at gmail.com
Mon Apr 13 03:03:27 PDT 2015
On Mon, Apr 13, 2015 at 11:16 AM, Christian Kehl <Christian.Kehl at uni.no>
wrote:
> 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 ?
>
>
Did you:
a) Link the plugins into your JNI code? This is needed because the
libraries are static, thus it cannot load them dynamically at runtime. It
is a workaround for complicated deployment on Android.
b) Declared which plugins you are using? Again, this is linked to the point
above, because the plugin registration has to be done at compile time when
using static linking. Make sure that you have something like this in your
code (add/remove the plugins you need/don't need):
//Static plugins Macro
USE_OSGPLUGIN(ive)
USE_OSGPLUGIN(osg)
USE_OSGPLUGIN(osg2)
USE_OSGPLUGIN(freetype)
//USE_OSGPLUGIN(terrain)
USE_OSGPLUGIN(rgb)
//USE_OSGPLUGIN(OpenFlight)
//USE_OSGPLUGIN(dds)
//Static DOTOSG
USE_DOTOSGWRAPPER_LIBRARY(osg)
//USE_DOTOSGWRAPPER_LIBRARY(osgFX)
//USE_DOTOSGWRAPPER_LIBRARY(osgParticle)
//USE_DOTOSGWRAPPER_LIBRARY(osgTerrain)
USE_DOTOSGWRAPPER_LIBRARY(osgText)
USE_DOTOSGWRAPPER_LIBRARY(osgAnimation)
//USE_DOTOSGWRAPPER_LIBRARY(osgViewer)
//USE_DOTOSGWRAPPER_LIBRARY(osgVolume)
//Static serializer
USE_SERIALIZER_WRAPPER_LIBRARY(osg)
USE_SERIALIZER_WRAPPER_LIBRARY(osgAnimation)
//USE_SERIALIZER_WRAPPER_LIBRARY(osgFX)
USE_SERIALIZER_WRAPPER_LIBRARY(osgManipulator)
//USE_SERIALIZER_WRAPPER_LIBRARY(osgParticle)
//USE_SERIALIZER_WRAPPER_LIBRARY(osgTerrain)
USE_SERIALIZER_WRAPPER_LIBRARY(osgText)
//USE_SERIALIZER_WRAPPER_LIBRARY(osgVolume)
Without this sort of declaration and the corresponding linking statement it
will not work when built as a fully static library.
J.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20150413/fc6669b4/attachment-0003.htm>
More information about the osg-users
mailing list