[osg-users] Can't access to assets in Android

michael kapelko kornerr at gmail.com
Thu Jul 12 03:12:38 PDT 2018


Hi.

In OpenSceneGraph cross-platform guide application I first unpacked
the resource into local drive, then accessed it the usual way.
Here's the sample:
https://github.com/OGStudio/openscenegraph-cross-platform-guide-application/blob/master/android/app/src/main/java/org/opengamestudio/osgapp/RenderActivity.java#L27

On 11 July 2018 at 16:40, Daniel Ponsoda <dponsoda at gmail.com> wrote:
> Hi everyone,
>
> I just compiled the example project for Android (osgAndroidExampleGLES2) and can't figure out how to load osgt files I've put inside the apk (assets folder).
>
> I'm trying to load cow.osgt using the load option that appears in the app's menu with no luck (no matter what path I give). The error message appearing in logcat is:
>
> -----------------------------------------
> E/Osg Viewer: There are 1 models to load
>               Loading: cow.osgt
> W/Osg Viewer: Error reading file cow.osgt: file not found
> E/Osg Viewer: Model not loaded
> -----------------------------------------
>
> The file is located inside the assets folder in the apk root: /assets/cow.osgt
>
> I tried these paths when loading:
> assets/cow.osgt
> /assets/cow.osgt
> cow.osgt
> /cow.osgt
>
> The last thing I tried after read a solution in another topic on this forum is to copy the file cow.osgt to the external sdcard and set read permissions in the manifest but still appears the same error (file not found). The path I used for this was /storage/emulated/0/cow.osgt (anyway, I don't want to use the sd card in my app)
>
> Any ideas on why is this happening?
>
> Thank you, in advance!
>
> Cheers,
> j
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=74309#74309
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


More information about the osg-users mailing list