tauri-apps / tauri-apps/plugins-workspace
[bug] blocking_pick_files() appears to panic in android
- Dominant language
- Rust
- Stars
- 1.8k
- Forks
- 602
- Avg merge
- 4d 14h
- Merged PRs (30d)
- 9
Description
### Describe the bug
I'm attempting to use the blocking_pick_files() dialog under android. Looks like it panics. The last log message is "timsg_err 2", right before the function call. The same code works for linux desktop.
```
#[tauri::command]
pub async fn timsg(
app_handle: tauri::AppHandle,
state: State<'_, ZkState>,
msg: zt::TauriRequest,
) -> Result {
info!("timsg");
match timsg_err(app_handle, state, msg).await {
Ok(ptd) => {
info!("we're back1");
Ok(ptd)
}
Err(e) => {
info!("we're back2");
Ok(TauriReply::TyServerError(e.to_string()))
}
}
}
pub async fn timsg_err(
app_handle: tauri::AppHandle,
state: State<'_, ZkState>,
msg: zt::TauriRequest,
) -> Result {
info!("timsg_err");
match msg {
zt::TauriRequest::TrqUploadFiles => {
info!("timsg_err 2");
// show open dialog
if let Some(flz) = app_handle.dialog().file().blocking_pick_files() {
info!("dee: {:?}", flz);
let paths = flz
.iter()
.filter_map(|x| x.clone().into_path().ok())
.collect();
return make_file_notes(&state, &paths)
.await
.map(|fls| zt::TauriReply::TyUploadedFiles(fls));
} else {
info!("dee None");
}
}
}
info!("timsg_err 3");
Ok(zt::TauriReply::TyUploadedFiles(zt::UploadedFiles {
notes: Vec::new(),
}))
}
```
### Reproduction
https://github.com/bburdette/tauri-zknotes/commit/329a69d93204a58b01bcb91f61bb51d673a56464
directions to build are on the readme.
### Expected behavior
Would like to see the file open dialog.
### Full `tauri info` output
```text
[⚠] Environment
- OS: NixOS 24.11.0 x86_64 (X64)
✔ webkit2gtk-4.1: 2.44.3
✔ rsvg2: 2.58.1
✔ rustc: 1.81.0 (eeb90cda1 2024-09-04)
✔ cargo: 1.81.0 (2dbb1af80 2024-08-20)
⚠ rustup: not installed!
If you have rust installed some other way, we recommend uninstalling it
then use rustup instead. Visit https://rustup.rs/
⚠ Rust toolchain: couldn't be detected!
Maybe you don't have rustup installed? if so, Visit https://rustup.rs/
- node: 20.15.1
- npm: 10.7.0
[-] Packages
- tauri 🦀: 2.2.5
- tauri-build 🦀: 2.0.5
- wry 🦀: 0.48.1
- tao 🦀: 0.31.1
- tauri-cli 🦀: 2.0.1
[-] Plugins
- tauri-plugin-dialog 🦀: 2.2.0
- tauri-plugin-fs 🦀: 2.2.0
[-] App
- build-type: bundle
- CSP: image-src *; media-src *
- frontendDist: static
- devUrl: http://0.0.0.0:8080/
```
### Stack trace
```text
```
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.