From 590dbce76936b520d8c34b63fa07f82153715190 Mon Sep 17 00:00:00 2001 From: sanjeevprasad Date: Tue, 26 Mar 2024 07:31:32 +0530 Subject: [PATCH] feat: show friendly error message if gradle not found (#295) --- src/android/aab.rs | 8 +++++++- src/android/apk.rs | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/android/aab.rs b/src/android/aab.rs index f531ac26..6a206e47 100644 --- a/src/android/aab.rs +++ b/src/android/aab.rs @@ -78,7 +78,13 @@ pub fn build( }); Ok(()) }) - .start()? + .start() + .map_err(|err| { + if err.kind() == std::io::ErrorKind::NotFound { + log::error!("`gradlew` not found. Make sure you have the Android SDK installed and added to your PATH"); + } + err + })? .wait()?; let mut outputs = Vec::new(); diff --git a/src/android/apk.rs b/src/android/apk.rs index 8b534af4..63e0b020 100644 --- a/src/android/apk.rs +++ b/src/android/apk.rs @@ -105,7 +105,13 @@ pub fn build( }); Ok(()) }) - .start()? + .start() + .map_err(|err| { + if err.kind() == std::io::ErrorKind::NotFound { + log::error!("`gradlew` not found. Make sure you have the Android SDK installed and added to your PATH"); + } + err + })? .wait()?; let mut outputs = Vec::new();