Open
Description
If you follow the docs to add updater like cargo tauri add updater
, it adds everything but you'll get this error: error[E0433]: failed to resolve: use of undeclared crate or module tauri_plugin_updater
.
The reason for this is because in the Cargo.toml
it will add tauri-plugin-updater
conditionally excluding mobile builds:
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
tauri-plugin-updater = "2.0.2"
Thus, the program cannot find tauri-plugin-updater when referenced in the lib.rs
builder.
I fixed this by doing:
let mut builder = tauri::Builder::default()
.plugin(tauri_plugin_dialog::init())
.plugin(tauri_plugin_fs::init())
.plugin(tauri_plugin_os::init())
.invoke_handler(tauri::generate_handler![
...
]);
#[cfg(not(any(target_os = "android", target_os = "ios")))]
{
builder = builder.plugin(tauri_plugin_updater::Builder::new().build());
}
One option is we can update the install script to also do this by default.
Activity