本文主要是介绍make otapackage 素材包太大导致的失败,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
该错误是由于android默认采用的是ZIP,因此当生成素材包的中间文件超出4G则会导致一系列的错误,解决方法可以采用ZIP64。
diff --git a/tools/releasetools/add_img_to_target_files.py b/tools/releasetools/add_img_to_target_files.py
index 5a0a411..e2982cd 100755
--- a/tools/releasetools/add_img_to_target_files.py
+++ b/tools/releasetools/add_img_to_target_files.py
@@ -334,7 +334,7 @@ def AddImagesToTargetFiles(filename):
common.ZipClose(input_zip)
output_zip = zipfile.ZipFile(filename, "a",
- compression=zipfile.ZIP_DEFLATED)
+ compression=zipfile.ZIP_DEFLATED, allowZip64=True)
has_recovery = (OPTIONS.info_dict.get("no_recovery") != "true")
diff --git a/tools/releasetools/img_from_target_files.py b/tools/releasetools/img_from_target_files.py
index 84e0e63..bd72337 100755
--- a/tools/releasetools/img_from_target_files.py
+++ b/tools/releasetools/img_from_target_files.py
@@ -70,7 +70,7 @@ def main(argv):
sys.exit(1)
OPTIONS.input_tmp, input_zip = common.UnzipTemp(args[0])
- output_zip = zipfile.ZipFile(args[1], "w", compression=zipfile.ZIP_DEFLATED)
+ output_zip = zipfile.ZipFile(args[1], "w", compression=zipfile.ZIP_DEFLATED, allowZip64=True)
CopyInfo(output_zip)
try:
diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py
index c7a6a34..e1bd62d 100755
--- a/tools/releasetools/ota_from_target_files.py
+++ b/tools/releasetools/ota_from_target_files.py
@@ -1243,7 +1243,7 @@ def WriteABOTAPackageWithBrilloScript(target_file, output_file,
# Stage the output zip package for package signing.
temp_zip_file = tempfile.NamedTemporaryFile()
output_zip = zipfile.ZipFile(temp_zip_file, "w",
- compression=zipfile.ZIP_DEFLATED)
+ compression=zipfile.ZIP_DEFLATED, allowZip64=True)
# Metadata to comply with Android OTA package format.
oem_props = OPTIONS.info_dict.get("oem_fingerprint_properties", None)
@@ -2131,11 +2131,11 @@ def main(argv):
if os.path.exists(args[1]):
os.unlink(args[1])
output_zip = zipfile.ZipFile(args[1], "w",
- compression=zipfile.ZIP_DEFLATED)
+ compression=zipfile.ZIP_DEFLATED, allowZip64=True)
else:
temp_zip_file = tempfile.NamedTemporaryFile()
output_zip = zipfile.ZipFile(temp_zip_file, "w",
- compression=zipfile.ZIP_DEFLATED)
+ compression=zipfile.ZIP_DEFLATED, allowZip64=True)
# Non A/B OTAs rely on /cache partition to store temporary files.
cache_size = OPTIONS.info_dict.get("cache_size", None)
--
这篇关于make otapackage 素材包太大导致的失败的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!