diff --git a/crates/scaffold-tauri-app/templates/end-user-happ/src-tauri/src/lib.rs.hbs b/crates/scaffold-tauri-app/templates/end-user-happ/src-tauri/src/lib.rs.hbs index 33f78f97..3c4627eb 100644 --- a/crates/scaffold-tauri-app/templates/end-user-happ/src-tauri/src/lib.rs.hbs +++ b/crates/scaffold-tauri-app/templates/end-user-happ/src-tauri/src/lib.rs.hbs @@ -87,13 +87,9 @@ async fn setup(handle: AppHandle) -> anyhow::Result<()> { } fn internal_ip() -> String { - if cfg!(mobile) { - std::option_env!("INTERNAL_IP") - .expect("Environment variable INTERNAL_IP was not set") - .to_string() - } else { - String::from("localhost") - } + std::option_env!("INTERNAL_IP") + .expect("Environment variable INTERNAL_IP was not set") + .to_string() } fn bootstrap_url() -> Url2 { diff --git a/docs/documentation/troubleshooting.md b/docs/documentation/troubleshooting.md index 6bbb9837..8cd14dce 100644 --- a/docs/documentation/troubleshooting.md +++ b/docs/documentation/troubleshooting.md @@ -40,6 +40,41 @@ pnpm tauri icon ``` ::: +### `Error Have you installed the Android SDK?` + +If you get this error: + +``` +Error Have you installed the Android SDK? The `ANDROID_HOME` environment variable isn't set, and is required: environment variable not found: environment variable not found +npm run tauri android dev exited with code 1 +``` + +It means you are trying to run your app in an Android device, but you are not inside your `androidDev` devShell, which is the one that includes the Android development environment and tooling. + +Enter the `androidDev` devShell with: + +```bash +nix develop .#androidDev +``` + +And try again. + +### `Error Android Studio project directory src-tauri/gen/android doesn't exist.` + +If you get this error: + +``` + Error Android Studio project directory src-tauri/gen/android doesn't exist. Please run `tauri android init` and try again. +``` + +It means you haven't initialized your project for Android developm̀ent yet. You can do so by running: + +```bash +npm run tauri android init +``` + +And then try running your command again. + ## NixOS Issues ### Connect to devices