tauri-apps / tray-icon

Tray icons for Desktop Applications.
Apache License 2.0
183 stars 27 forks source link

tray-icon = "0.14.0" Failed to reference on win11 #163

Closed DWHengr closed 1 month ago

DWHengr commented 1 month ago

error: failed to select a version for gtk-sys. ... required by package rfd v0.9.0 ... which satisfies dependency rfd = "^0.9" of package tauri v1.0.0 ... which satisfies dependency tauri = "^1" of package linyu-client v0.0.1 (C:\Users\duwei\Desktop\linyu\linyu-client\src-tauri) versions that meet the requirements ^0.15.1 are: 0.15.3, 0.15.1

the package gtk-sys links to the native library gtk-3, but it conflicts with a previous package which links to gtk-3 as well: package gtk-sys v0.18.0 ... which satisfies dependency ffi = "^0.18" of package gtk v0.18.1 ... which satisfies dependency gtk = "^0.18" of package libappindicator v0.9.0 ... which satisfies dependency libappindicator = "^0.9" of package tray-icon v0.14.0 ... which satisfies dependency tray-icon = "^0.14.0" of package linyu-client v0.0.1 (C:\Users\heath\Desktop\linyu\linyu-client\src-tauri) Only one package in the dependency graph may specify the same links value. This helps ensure that only one copy of a native library is linked in the final binary. Try to adjust your dependencies so that only one package uses the links ='gtk-sys' value. For more information, see https://doc.rust-lang.org/cargo/reference/resolver.html#links.

FabianLars commented 1 month ago

You can't use tray-icon with Tauri v1, only in v2 (it's part of tauri v2 so no need to use this crate). This is not a bug, more like a limitation.

DWHengr commented 1 month ago

So how do I use it in v1

DWHengr commented 1 month ago

Or do I have to use v2 to use this tray event

FabianLars commented 1 month ago

Like I said, you can't use this library in v1. You need to migrate to v2 if Tauri's v1 tray apis don't work for you.

DWHengr commented 1 month ago

Ok, so is there a good way to migrate v1 to v2?

FabianLars commented 1 month ago

We're working on migration docs here https://beta.tauri.app/start/migrate/from-tauri-1/ (not perfect yet). If your app is new/small i'd recommend to just create a new one via create-tauri-app --beta and move your old files over.

DWHengr commented 1 month ago

In the v2 version, the tray icon version uses 0.13.5. How do I use 0.14.0. @FabianLars

FabianLars commented 1 month ago

You can wait for us to update it, open a PR to update it, or use the tray-icon crate directly (a bit harder because of the threading requirements)

FabianLars commented 1 month ago

Nevermind, Tauris was already updated. In the next tauri release you'll have access to 0.14