From 9f12df9abb5818ebaa581d05c17651244bf52e6f Mon Sep 17 00:00:00 2001 From: Ulya Trafimovich Date: Mon, 29 Mar 2021 14:06:58 +0100 Subject: Don't fail the build if manifest_check cannot extract targetSdkVersion. Instead, return "any" SDK version 10000, which will cause dexpreopt to not add any compatibility libraries to class loader context. This is as good guess as any, and the build system already uses "any" version if there is not manifest or APK from which to extract targetSdkVersion. This fixes broken build on cf_x86_auto-userdebug. Bug: 132357300 Bug: 183943146 Test: lunch cf_x86_auto-userdebug \ && m out/target/product/vsoc_x86/obj/APPS/playback_intermediates/dexpreopt.zip Change-Id: I5ee75639ece716c3a9800ddea346fe7c73da7c3a --- scripts/manifest_check.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'scripts/manifest_check.py') diff --git a/scripts/manifest_check.py b/scripts/manifest_check.py index 1343f3563..907f239cf 100755 --- a/scripts/manifest_check.py +++ b/scripts/manifest_check.py @@ -289,7 +289,12 @@ def main(): f.write("%s\n" % errmsg) if args.extract_target_sdk_version: - print(extract_target_sdk_version(manifest, is_apk)) + try: + print(extract_target_sdk_version(manifest, is_apk)) + except: + # Failed; don't crash, return "any" SDK version. This will result in + # dexpreopt not adding any compatibility libraries. + print(10000) if args.output: # XML output is supposed to be written only when this script is invoked -- cgit v1.2.3-59-g8ed1b