tauri-apps / tauri

Build smaller, faster, and more secure desktop and mobile applications with a web frontend.
https://tauri.app
Apache License 2.0
84.23k stars 2.53k forks source link

System Error upon starting Windows app #875

Closed MaKleSoft closed 4 years ago

MaKleSoft commented 4 years ago

Describe the bug

Starting the Windows app fails with the message:

The code execution cannot proceed because WebView2Loader.dll was not found. Reinstalling the program may fix this problem.

Screenshots

Screenshot 2020-07-21 at 17 27 03

Platform and Versions (please complete the following information):

[tauri]: running info

Operating System - Windows_NT(10.0.19041) - win32/x64
Microsoft Edge - 44.19041.1.0_neutral__8wekyb3d8bbwe

Node.js environment
  Node.js - 12.18.2
  tauri.js - 0.10.0

Rust environment
  rustc - 1.45.0
  cargo - 1.45.0
  tauri-bundler - 0.9.0

Global packages
  NPM - 6.14.5
  yarn - Not installed

App directory structure
/dist
/node_modules
/src
/src-tauri

App
  tauri.rs - 0.8.0
  mode - embedded-server
  build-type - bundle
  CSP - default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline'
  distDir - ../dist
  devPath - http://localhost:8080
lucasfernog commented 4 years ago

Thank you for reporting it!

noseratio commented 2 years ago

I've just tried npx create-tauri-app on fresh Windows 11 OS (I did follow "Setup for Windows" for prereqs). The build completes OK, but I'm still getting this The code execution cannot proceed because WebView2Loader.dll was not found error:

image

I get it both when running .\tauri-app\src-tauri\target\release\tauri-app.exe and when installing .\tauri-app\src-tauri\target\release\bundle\msi\tauri-app_0.1.0_x64.msi and running it from the installed location.

I was able to run the app by downloading microsoft.web.webview2.1.0.1020.30.nupkg and extracting WebView2Loader.dll from there.

Is there anything I can help with to diagnose this, @lucasfernog? Thank you!

lucasfernog commented 2 years ago

Did you install the webview2 runtime?

noseratio commented 2 years ago

Did you install the webview2 runtime?

I did and verified that, my Blazor/Desktop "hello world" app worked out of the box.

Although I don't think I should have manually installed the WebView2 runtime under Windows 11, doesn't it come bundled with that OS?

amrbashir commented 2 years ago

@noseratio can you provide 'tauri info' ? also try asking in our discord server we can help triage it faster there.

noseratio commented 2 years ago

@noseratio can you provide 'tauri info' ? also try asking in our discord server we can help triage it faster there.

Operating System - Windows, version 10.0.22000 X64
Webview2 - 95.0.1020.44

Node.js environment
  Node.js - 17.1.0
  @tauri-apps/cli - 1.0.0-beta.10
  @tauri-apps/api - 1.0.0-beta.8

Global packages
  npm - 8.1.2
  yarn - Not installed

Rust environment
  rustc - 1.56.1
  cargo - 1.56.0

App directory structure
/dist
/node_modules
/src-tauri

App
  tauri.rs - 1.0.0-beta.8
  build-type - bundle
  CSP - default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'
  distDir - ../dist
  devPath - ../dist
FabianLars commented 2 years ago

Isn't that the "I'm using the gnu toolchain" error? .You can check the with rustup toolchain list for example. It used to work but as you already found out, the dll download doesn't work anymore. The imo best "workaround" would be to use the msvc toolchain instead, cause that's also more future proof considering that the new bindings used on the next branch seemingly don't work at all with the gnu toolchain. Otherwise downloading the dll manually and placing them in the target folder before bundling should work on the current release (tauri should pull it into the msi automatically if it's there).

noseratio commented 2 years ago

Isn't that the "I'm using the gnu toolchain" error? .You can check the with rustup toolchain list for example.

That was it, thank you @FabianLars. I was indeed using MinGW, which I installed after my first attempt to npm run tauri build failed with gcc.exe was missing message. Though I did have Visual Studio 2019 installed.

Now I've reinstalled "Visual Studio 2019 Build Tools" (choco install visualstudio2019buildtools), "Visual C++ build tools workload" (choco install visualstudio2019-workload-vctools), rustup, and then was able to built and run the app without the WebView2Loader issue.

Thanks again!