File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,13 +8,13 @@ use thiserror::Error;
88pub enum NdkError {
99 #[ error(
1010 "Android SDK is not found. \
11- Please set the path to the Android SDK with the $ANDROID_SDK_ROOT \
11+ Please set the path to the Android SDK with the $ANDROID_HOME \
1212 environment variable."
1313 ) ]
1414 SdkNotFound ,
1515 #[ error(
1616 "Android NDK is not found. \
17- Please set the path to the Android NDK with $ANDROID_NDK_ROOT \
17+ Please set the path to the Android NDK with $NDK_HOME \
1818 environment variable."
1919 ) ]
2020 NdkNotFound ,
Original file line number Diff line number Diff line change @@ -85,8 +85,10 @@ impl Ndk {
8585 . max ( )
8686 . ok_or ( NdkError :: BuildToolsNotFound ) ?;
8787
88- let build_tag = std:: fs:: read_to_string ( ndk_path. join ( "source.properties" ) )
89- . expect ( "Failed to read source.properties" ) ;
88+ let Ok ( build_tag) = std:: fs:: read_to_string ( ndk_path. join ( "source.properties" ) ) else {
89+ eprintln ! ( "Failed to read source.properties. Maybe NDK is not at {:?}." , ndk_path) ;
90+ return Err ( NdkError :: NdkNotFound ) ;
91+ } ;
9092
9193 let build_tag = build_tag
9294 . split ( '\n' )
You can’t perform that action at this time.
0 commit comments