#What should I use instead of path_resolver in v2?

2 messages · Page 1 of 1 (latest)

median abyss
#

I'm migrating from v1 and I have an AppHandle calling the method "path_resolver()".
I'm getting the error message: "no method named 'path resolver' found for struct 'AppHandle' ".
What can I do to replace path_resolver?

indigo orchid
#

Hey,
I had the same problem yesterday.
Old code v1:
let app_dir = tauri::api::path::app_data_dir(&app_handle.config()).unwrap();
or
let app_dir = app_handle.path_resolver().app_dir();
new code v2:
let app_dir = app_handle.path().app_data_dir().unwrap();
So basicly use path instead of path resolver and be aware that there might be more changes.
You also need to include:
use tauri::Manager;