Skip to content

Commit f6163b5

Browse files
committed
Improved Android API error reporting
1 parent 165036c commit f6163b5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pythonforandroid/toolchain.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,8 +572,12 @@ def prepare_build_environment(self, user_sdk_dir, user_ndk_dir,
572572
android_api = None
573573
if user_android_api:
574574
android_api = user_android_api
575+
if android_api is not None:
576+
info('Getting Android API version from user argument')
575577
if android_api is None:
576578
android_api = environ.get('ANDROIDAPI', None)
579+
if android_api is not None:
580+
info('Found Android API target in $ANDROIDAPI')
577581
if android_api is None:
578582
info('Android API target was not set manually, using '
579583
'the default of {}'.format(DEFAULT_ANDROID_API))
@@ -588,7 +592,9 @@ def prepare_build_environment(self, user_sdk_dir, user_ndk_dir,
588592
if android_api in apis:
589593
info('Requested API target {} is available, continuing.'.format(android_api))
590594
else:
591-
warning('Requested API target {} is not available, exiting.'.format(android_api))
595+
warning('Requested API target {} is not available, install '
596+
'it with the SDK android tool.'.format(android_api))
597+
warning('Exiting.')
592598
exit(1)
593599

594600
exit(1)

0 commit comments

Comments
 (0)