Skip to content

multiple webviews #55

Description

@JohannHilbold

Hi,
I'm building a KMP app aimed at windows/desktop that displays several webviews. I have a panel on the right that always shows a webview and a main panel that can display a webview. This worked fine without nucleus tao in v1.0.0-beta-02, but every now and then (?), the panel on the right would show a shadow of itself. Either a white rectangle or the actual loaded webpage, but in the wrong position, my guess is defaulting to 0,0.
I've done the upgrade to 1.0.1 this morning and the right panel always shows correctly as it should. But now, it looks like the framework cannot display 2 (or more) webviews in the same Tao window. I have tried giving them a different context folder, I still get this error at runtime

Error was captured in composition.
java.lang.IllegalArgumentException: Failed to create WebView2 (is WebView2 Runtime installed?)
at dev.nucleusframework.webview.web.windows.WindowsWebView2NativeWebView.(WindowsWebView2NativeWebView.kt:70)
at dev.nucleusframework.webview.web.windows.WindowsWebView2NativeWebView.(WindowsWebView2NativeWebView.kt)
at dev.nucleusframework.webview.web.WebViewDesktopKt.defaultWebViewFactory(WebViewDesktop.kt:89)
at dev.nucleusframework.webview.web.WebViewKt$WebView$factory$1$1.invoke(WebView.kt:30)
at dev.nucleusframework.webview.web.WebViewKt$WebView$factory$1$1.invoke(WebView.kt:30)
at dev.nucleusframework.webview.web.WebViewDesktopKt.ActualWebView(WebViewDesktop.kt:151)
at dev.nucleusframework.webview.web.WebViewKt.WebView(WebView.kt:64)
at no.nrk.radiostudio.composables.App_desktopKt.WebView(App.desktop.kt:346)
at no.nrk.radiostudio.composables.App_desktopKt.WebView$lambda$33(App.desktop.kt)
at androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.kt:204)
at androidx.compose.runtime.GapComposer.recomposeToGroupEnd(GapComposer.kt:1678)
at androidx.compose.runtime.GapComposer.skipCurrentGroup(GapComposer.kt:2014)
at androidx.compose.runtime.GapComposer.doCompose-aFTiNEg(GapComposer.kt:2655)
at androidx.compose.runtime.GapComposer.recompose-aFTiNEg$runtime(GapComposer.kt:2577)
at androidx.compose.runtime.CompositionImpl.recompose(Composition.kt:1164)
at androidx.compose.runtime.Recomposer.performRecompose(Recomposer.kt:1318)
at androidx.compose.runtime.Recomposer.access$performRecompose(Recomposer.kt:191)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2.invokeSuspend$lambda$2(Recomposer.kt:655)
at androidx.compose.runtime.BroadcastFrameClock$FrameAwaiter.resume(BroadcastFrameClock.kt:56)
at androidx.compose.runtime.BroadcastFrameClock.sendFrame$lambda$0(BroadcastFrameClock.kt:71)
at androidx.compose.runtime.internal.AwaiterQueue.flushAndDispatchAwaiters(AwaiterQueue.kt:89)
at androidx.compose.runtime.BroadcastFrameClock.sendFrame(BroadcastFrameClock.kt:71)
at androidx.compose.ui.scene.BaseComposeScene.render(BaseComposeScene.skiko.kt:173)
at dev.nucleusframework.window.tao.scene.TaoComposeSceneHostWindows.onRedrawRequested(TaoComposeSceneHostWindows.kt:1143)
at dev.nucleusframework.window.tao.DecoratedWindowKt.openDecoratedWindowWindows_zVQR62M$lambda$20(DecoratedWindow.kt:1364)
at dev.nucleusframework.window.tao.TaoWindow.dispatch$Nucleus_decorated_window_tao(TaoWindow.kt:879)
at dev.nucleusframework.window.tao.TaoApplication$EventDispatcher.onEvent(TaoApplication.kt:134)
at dev.nucleusframework.window.tao.ffi.NativeTaoBridge.nativeRunBlocking(Native Method)
at dev.nucleusframework.window.tao.TaoApplication.run(TaoApplication.kt:59)
at dev.nucleusframework.window.tao.TaoApplicationComposeKt.taoApplication(TaoApplicationCompose.kt:51)
at no.nrk.radiostudio.MainKt.main(main.kt:96)
Exception in thread "main" java.lang.IllegalArgumentException: Failed to create WebView2 (is WebView2 Runtime installed?)
at dev.nucleusframework.webview.web.windows.Winit>(WindowsWebView2NativeWebView.kt:70)
at dev.nucleusframework.webview.web.windows.WindowsWebView2NativeWebView.(WindowsWebView2NativeWebView.kt)
at dev.nucleusframework.webview.web.WebViewDesktopKt.defaultWebViewFactory(WebViewDesktop.kt:89)
at dev.nucleusframework.webview.web.WebViewKt$bView.kt:30)
at dev.nucleusframework.webview.web.WebViewKt$bView.kt:30)
at dev.nucleusframework.webview.web.WebViewDesktopKt.ActualWebView(WebViewDesktop.kt:151)
at dev.nucleusframework.webview.web.WebViewKt.WebView(WebView.kt:64)
at no.nrk.radiostudio.composables.App_desktopKt.WebView(App.desktop.kt:346)
at no.nrk.radiostudio.composables.App_desktopKop.kt)
at androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.kt:204)
at androidx.compose.runtime.GapComposer.recomposeToGroupEnd(GapComposer.kt:1678)
at androidx.compose.runtime.GapComposer.skipCurrentGroup(GapComposer.kt:2014)
at androidx.compose.runtime.GapComposer.doCompose-aFTiNEg(GapComposer.kt:2655)
at androidx.compose.runtime.GapComposer.recompose-aFTiNEg$runtime(GapComposer.kt:2577)
at androidx.compose.runtime.CompositionImpl.recompose(Composition.kt:1164)
at androidx.compose.runtime.Recomposer.performRecompose(Recomposer.kt:1318)
at androidx.compose.runtime.Recomposer.access$performRecompose(Recomposer.kt:191)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2.invokeSuspend$lambda$2(Recomposer.kt:655)
at androidx.compose.runtime.BroadcastFrameClock$FrameAwaiter.resume(BroadcastFrameClock.kt:56)
at androidx.compose.runtime.BroadcastFrameClock.sendFrame$lambda$0(BroadcastFrameClock.kt:71)
at androidx.compose.runtime.internal.AwaiterQueue.flushAndDispatchAwaiters(AwaiterQueue.kt:89)
at androidx.compose.runtime.BroadcastFrameClocck.kt:71)
at androidx.compose.ui.scene.BaseComposeScene.render(BaseComposeScene.skiko.kt:173)
at dev.nucleusframework.window.tao.scene.TaoComposeSceneHostWindows.onRedrawRequested(TaoComposeSceneHostWindows.kt:1143)
at dev.nucleusframework.window.tao.DecoratedWindowKt.openDecoratedWindowWindows_zVQR62M$lambda$20(DecoratedWindow.kt:1364)
at dev.nucleusframework.window.tao.TaoWindow.ddow_tao(TaoWindow.kt:879)
at dev.nucleusframework.window.tao.TaoApplication$EventDispatcher.onEvent(TaoApplication.kt:134)
at dev.nucleusframework.window.tao.ffi.NativeTaoBridge.nativeRunBlocking(Native Method)
at dev.nucleusframework.window.tao.TaoApplication.run(TaoApplication.kt:59)
at dev.nucleusframework.window.tao.TaoApplicationComposeKt.taoApplication(TaoApplicationCompose.kt:51)
at myapp.MainKT.main(main.kt:96)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [androidx.compose.runtime.BroadcastFrameClock@f557c37, StandaloneCoroutine{Cancelling}@1a01d7f0, FlushCoroutineDispatcher@5856dbe4]

Is there a plan to support multiple webviews in the same window?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions