0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

AppHandlerのhideメソッドはwindowsでは使えない 【MacでのTauriアプリケーション開発時に気をつけること】

Last updated at Posted at 2025-09-16

Mac で Tauri アプリケーションを開発するときに注意するとこの備忘録です。
Mac 上で開発するときは何もなかったのですが、Tauri アプリケーションを Windows 環境でビルドしようとするとコンパイルエラーになってしまいました。

error[E0599]: no method named `hide` found for reference `&AppHandle<_>` in the current scope
  --> src\lib.rs:55:29
   |
55 |                         app.hide().unwrap();
   |                             ^^^^ method not found in `&AppHandle<_>`

windows 環境では、AppHandleにはhideメソッドはないようです。
ソースコードを読んでみたら確かに #[cfg(target_os = "macos")] がついてました。

なので、ウィンドウを隠す処理を Windows 環境で動作させたければ webview_window.hide() を使いましょう。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?