Skip to content

[Windows] Failed to create WebView2 (is WebView2 Runtime installed?) #63

Description

@ylk2534246654

Environment

  • OS: Windows 11 25H2 (OS Build 26200.9445)
  • JDK: 21
  • Compose Native Webview version: 1.0.3
  • Nucleus version: 2.5.5
  • Gradle:9.5.1
  • Kotlin 2.4.10
  • Compose Multiplatform 1.11.1
  • WebView2 Runtime version: 152.0.4191.66
  • WebView2 executable path: C:\Program Files (x86)\Microsoft\EdgeWebView\Application\152.0.4191.66\msedgewebview2.exe

Description

I am getting the following exception when creating a WebView on Windows 11. The WebView2 Runtime appears to be installed, and msedgewebview2.exe exists at the path above, but the library still reports that WebView2 could not be created.

Steps to reproduce

  1. Check out the repository at tag v1.0.3.
  2. Build the desktop example using the documented command:
    ./gradlew :e2e-desktop:run
    
    or package a distributable.
  3. Run the packaged desktop binary on Windows 11.
  4. The app crashes when the WebView is created.

Expected behavior

The WebView should be created successfully using the installed WebView2 Runtime.

Actual behavior

It throws:

Exception in thread "main" java.lang.IllegalArgumentException: Failed to create WebView2 (is WebView2 Runtime installed?)
	at dev.nucleusframework.webview.web.windows.WindowsWebView2NativeWebView.<init>(WindowsWebView2NativeWebView.kt:73)
	at dev.nucleusframework.webview.web.windows.WindowsWebView2NativeWebView.<init>(WindowsWebView2NativeWebView.kt)
	at dev.nucleusframework.webview.web.WebViewDesktopKt.defaultWebViewFactory(WebViewDesktop.kt:115)
	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:182)
	at dev.nucleusframework.webview.web.WebViewKt.WebView(WebView.kt:64)
	at dev.nucleusframework.webview.e2e.visualsuite.VisualSuiteAppKt.VisualSuiteApp(VisualSuiteApp.kt:269)

Troubleshooting already tried

  • Confirmed that this file exists:
    C:\Program Files (x86)\Microsoft\EdgeWebView\Application\152.0.4191.66\msedgewebview2.exe

  • Confirmed WebView2 Runtime installation:

    Get-ChildItem "HKLM:SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients" | Where-Object PSChildName -eq "{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}"

    Output:

    Hive: HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients
    Name                           Property
    ----                           --------
    {F3017226-FE2A-4295-8BDF-00C3A name            : Microsoft Edge WebView2 Runtime
    9A7E4C5}                       location        : C:\Program Files (x86)\Microsoft\EdgeWebView\Application
                                   pv              : 152.0.4191.66
                                   SilentUninstall : "C:\Program Files (x86)\Microsoft\EdgeWebView\Application\152.0.4191.6
                                   6\Installer\setup.exe" --force-
                                                     uninstall --uninstall --msedgewebview --system-level --verbose-logging
    
  • Checked registry:

    reg query "HKLM\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" /v pv

    Output:

    HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}
      pv    REG_SZ    152.0.4191.66
    

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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