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

Adding Webview in ViewRenderable leads to MissingGlContextException #474

Open sawan94 opened 5 years ago

sawan94 commented 5 years ago

If I add a webview to my layout , com.google.ar.core.exceptions.MissingGlContextException at com.google.ar.core.az.a(Session.java:2) at com.google.ar.core.Session.throwExceptionFromArStatus(Session.java:105) at com.google.ar.core.Session.nativeUpdate(Native Method) at com.google.ar.core.Session.update(Session.java:50) at com.google.ar.sceneform.ArSceneView.onBeginFrame(Unknown Source:10) at com.google.ar.sceneform.SceneView.doFrame(Unknown Source:16) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1002) at android.view.Choreographer.doCallbacks(Choreographer.java:816) at android.view.Choreographer.doFrame(Choreographer.java:748) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:990) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6863) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

Removing the Webview everything works fine. Using Arsceneview

mkeblx commented 5 years ago

@sawan94 I encountered the same but was able to get working, not positive how. But here is a working example, I modified the hellosceneform example: https://github.com/mkeblx/sceneform-android-sdk/tree/webview-test

JL-Vidinoti commented 5 years ago

After some tests, I have observed that it occurs when the WebView is added in the XML layout. When the WebView is added programmatically to the layout, it does not occur. Edit: it looks like it crashes if webView.loadUrl() is not called...