google-ar / sceneform-android-sdk

Sceneform SDK for Android
https://developers.google.com/sceneform/develop/
Apache License 2.0
1.23k stars 604 forks source link

No implementation found for long com.google.android.filament.Stream.nCreateBuilder() #574

Open martinbonnin opened 5 years ago

martinbonnin commented 5 years ago

It looks like I can't call ViewRenderable.builder().setView(context, id).build() before an actual ArFragment View has been inflated/created.

To reproduce, move the call to ViewRenderable.builder().setView(context, id).build() above setContentView in the solar system example like here: https://github.com/martinbonnin/sceneform-android-sdk/commit/29032b0a7437e7eb9d3ffa9a9807e91e957cda5e

I'm fine with this limitation but it could be more explicit (doc or specific error message ?)

java.lang.UnsatisfiedLinkError: No implementation found for long com.google.android.filament.Stream.nCreateBuilder() (tried Java_com_google_android_filament_Stream_nCreateBuilder and Java_com_google_android_filament_Stream_nCreateBuilder__)
    at com.google.android.filament.Stream.nCreateBuilder(Native Method)
    at com.google.android.filament.Stream.access$000(Stream.java:26)
    at com.google.android.filament.Stream$Builder.<init>(Stream.java:41)
    at com.google.ar.sceneform.rendering.ExternalTexture.<init>(ExternalTexture.java:42)
    at com.google.ar.sceneform.rendering.RenderViewToExternalTexture.<init>(RenderViewToExternalTexture.java:52)
    at com.google.ar.sceneform.rendering.ViewRenderable.<init>(ViewRenderable.java:110)
    at com.google.ar.sceneform.rendering.ViewRenderable$Builder.makeRenderable(ViewRenderable.java:441)
    at com.google.ar.sceneform.rendering.ViewRenderable$Builder.makeRenderable(ViewRenderable.java:364)
    at com.google.ar.sceneform.rendering.Renderable$Builder.build(Renderable.java:355)
    at com.google.ar.sceneform.rendering.ViewRenderable$Builder.build(ViewRenderable.java:433)
    at com.google.ar.sceneform.samples.solarsystem.SolarActivity.onCreate(SolarActivity.java:97)
romainguy commented 5 years ago

This most likely happen because Filament needs to be initialized (to load its native libraries) which I assume Sceneform does in ArFragmentView and/or other views. This limitation should indeed be documented or a public API should be provided to make this work. Thanks for noticing!