Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ndk-build/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ use thiserror::Error;
pub enum NdkError {
#[error(
"Android SDK is not found. \
Please set the path to the Android SDK with the $ANDROID_SDK_ROOT \
Please set the path to the Android SDK with the $ANDROID_HOME \
environment variable."
)]
SdkNotFound,
#[error(
"Android NDK is not found. \
Please set the path to the Android NDK with $ANDROID_NDK_ROOT \
Please set the path to the Android NDK with $NDK_HOME \
environment variable."
)]
NdkNotFound,
Expand Down
6 changes: 4 additions & 2 deletions ndk-build/src/ndk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,10 @@ impl Ndk {
.max()
.ok_or(NdkError::BuildToolsNotFound)?;

let build_tag = std::fs::read_to_string(ndk_path.join("source.properties"))
.expect("Failed to read source.properties");
let Ok(build_tag) = std::fs::read_to_string(ndk_path.join("source.properties")) else {
eprintln!("Failed to read source.properties. Maybe NDK is not at {:?}.", ndk_path);
return Err(NdkError::NdkNotFound);
};

let build_tag = build_tag
.split('\n')
Expand Down