[v2] Conditional capabilities vs. platform #10400
-
I managed to make my application to not include window state plugin in case of android or ios and got it running on android emulator. The question is how can I make the permission files in the pub fn run() {
#[cfg(any(target_os = "android", target_os = "ios"))]
{
tauri::Builder::default()
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
#[cfg(not(any(target_os = "android", target_os = "ios")))]
{
tauri::Builder::default()
.plugin(tauri_plugin_window_state::Builder::default().build());
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
} And [target."cfg(not(any(target_os = \"android\", target_os = \"ios\")))".dependencies]
tauri-plugin-window-state = "=2.0.0-beta.11" But here is the error if the permission file is not deleted:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
You can have multiple capabilities files like this for example https://github.com/tauri-apps/plugins-workspace/tree/v2/examples/api/src-tauri/capabilities |
Beta Was this translation helpful? Give feedback.
You can have multiple capabilities files like this for example https://github.com/tauri-apps/plugins-workspace/tree/v2/examples/api/src-tauri/capabilities