0

Unable to create AB OTA zip file in AOSP11.

Please find below error:

test@test:~/aosp/test1_android$ ./build/tools/releasetools/ota_from_target_files out/dist/rockpi4b-target_files-eng.test.zip update.zip

2022-05-26 20:05:32 - common.py - WARNING : Failed to read SYSTEM/etc/build.prop

2022-05-26 20:05:32 - common.py - WARNING : Failed to read VENDOR/etc/build.prop

2022-05-26 20:05:32 - common.py - WARNING : Failed to read PRODUCT/etc/build.prop

2022-05-26 20:05:32 - common.py - WARNING : Failed to read SYSTEM_EXT/etc/build.prop

2022-05-26 20:05:55 - common.py - WARNING : Failed to read SYSTEM/etc/build.prop

2022-05-26 20:05:55 - common.py - WARNING : Failed to read VENDOR/etc/build.prop

2022-05-26 20:05:55 - common.py - WARNING : Failed to read PRODUCT/etc/build.prop

2022-05-26 20:05:55 - common.py - WARNING : Failed to read SYSTEM_EXT/etc/build.prop

2022-05-26 20:05:55 - common.py - WARNING : Failed to read SYSTEM/etc/build.prop

2022-05-26 20:05:55 - common.py - WARNING : Failed to read VENDOR/etc/build.prop

2022-05-26 20:05:55 - common.py - WARNING : Failed to read PRODUCT/etc/build.prop

2022-05-26 20:05:55 - common.py - WARNING : Failed to read SYSTEM_EXT/etc/build.prop

2022-05-26 20:05:55 - common.py - WARNING : Failed to read SYSTEM/etc/build.prop

2022-05-26 20:05:55 - common.py - WARNING : Failed to read VENDOR/etc/build.prop

2022-05-26 20:05:55 - common.py - WARNING : Failed to read PRODUCT/etc/build.prop

2022-05-26 20:05:55 - common.py - WARNING : Failed to read SYSTEM_EXT/etc/build.prop

2022-05-26 20:05:57 - ota_from_target_files - WARNING : Duplicate block difference found. 
Device specific block diff for partition 'system_ext' overrides the one in generic script.

2022-05-26 20:05:57 - ota_from_target_files - WARNING : Duplicate block difference found. Device specific block diff for partition 'product' overrides the one in generic script.

2022-05-26 20:05:57 - ota_from_target_files - WARNING : Duplicate block difference found. Device specific block diff for partition 'odm' overrides the one in generic script.

Compressing system.new.dat with brotli

Compressing vendor.new.dat with brotli

Compressing product.new.dat with brotli

Compressing odm.new.dat with brotli

Compressing system_ext.new.dat with brotli

write trust now...

write uboot now...

warning: no vbmeta.img in input target_files; not flashing vbmeta

wirte dtbo now...

no charge img; ignore it.

info: no resource image; ignore it.

no RKLoader.bin, ignore it.

info: no vendor_boot.img in input target_files; ignore it

info: no logo image; ignore it.
2022-05-26 20:07:28 - ota_from_target_files - ERROR   : 

   ERROR:

Traceback (most recent call last):
  File "./build/tools/releasetools/ota_from_target_files", line 2258, in <module>
    main(sys.argv[1:])

  File "./build/tools/releasetools/ota_from_target_files", line 2237, in main
    source_file=OPTIONS.incremental_source)

  File "./build/tools/releasetools/ota_from_target_files", line 1980, in GenerateNonAbOtaPackage
    output_file)

  File "./build/tools/releasetools/ota_from_target_files", line 880, in WriteFullOTAPackage

    FinalizeMetadata(metadata, staging_file, output_file, needed_property_files)

  File "./build/tools/releasetools/ota_from_target_files", line 1328, in FinalizeMetadata
    prelim_signing = ComputeAllPropertyFiles(input_file, needed_property_files)

  File "./build/tools/releasetools/ota_from_target_files", line 1314, in ComputeAllPropertyFiles
    SignOutput(input_file, prelim_signing)

  File "./build/tools/releasetools/ota_from_target_files", line 492, in SignOutput
    whole_file=True)

  File "/home/test/aosp/test1_android/build/make/tools/releasetools/common.py", line 1854, in SignFile
    proc.returncode, stdoutdata))

ExternalError: Failed to run signapk.jar: return code 1:

Error: Unable to access jarfile 

/home/test/aosp/test1_android/build/make/tools/framework/signapk.jar

Can you please help me , how to overcome this error.

CRM
  • 4,569
  • 4
  • 27
  • 33
GNK
  • 1,036
  • 2
  • 10
  • 29

2 Answers2

0

ota_from_target_files acts different in android 11.

If you have executed "make dist", the otatools is put in out/dist/otatools.zip, or you can "make otatools-package", the otatools will put in out/target/product/xxxx/otatools.zip.

All the dependency is packed in otatools.zip, then you can use ota_from_target_files in otatools.zip to make ota zip.

Yong
  • 1,529
  • 12
  • 21
  • Thank you for your reply. otatools.zip are generated in my out directory. Could you please share with me the steps to create a proper OTA .zip file? That will be very helpful for me. – GNK May 27 '22 at 04:42
  • https://source.android.com/devices/tech/ota/tools https://source.android.com/devices/tech/ota/sign_builds – Yong May 27 '22 at 06:56
  • Yes, I have followed the same links, getting the same error after running "ota_from_target_files dist_output/tardis-target_files.zip ota_update.zip" this command. – GNK May 27 '22 at 07:03
  • Unzip otatools.zip, then run the ota_from_target_files in unziped directory – Yong May 27 '22 at 07:26
  • 2022-05-27 13:41:42 - common.py - WARNING : Failed to read SYSTEM/etc/build.prop 2022-05-27 13:41:42 - common.py - WARNING : Failed to read VENDOR/etc/build.prop 2022-05-27 13:41:42 - common.py - WARNING : Failed to read PRODUCT/etc/build.prop 2022-05-27 13:41:42 - common.py - WARNING : Failed to read SYSTEM_EXT/etc/build.prop Traceback (most recent call last): File "/tmp/targetfiles-5bq28dqa/META/releasetools.py", line 54 print "write parameter.bin now" ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print("write parameter.bin now")? – GNK May 27 '22 at 08:16
  • releasetools.py is the oem python script, which will be called by ota_from_target_files. It's set by TARGET_RELEASETOOLS_EXTENSIONS. The post error is in releasetools.py. By the way, you have not enable a/b. If you have enable a/b, TARGET_RELEASETOOLS_EXTENSIONS will not be used. – Yong May 27 '22 at 08:39
  • its already set ifeq ($(TARGET_RELEASETOOLS_EXTENSIONS),) # default to common dir for device vendor tool_extensions := $(TARGET_DEVICE_DIR)/../common else tool_extensions := $(TARGET_RELEASETOOLS_EXTENSIONS) endif in build/make/core/Makefile – GNK May 27 '22 at 10:08
  • Can you please help me to share any ref links , I will understand more. – GNK May 27 '22 at 10:09
  • Now error is not coming but getting below massage 2022-05-27 15:43:16 - common.py - WARNING : Failed to read SYSTEM/etc/build.prop 2022-05-27 15:43:16 - common.py - WARNING : Failed to read SYSTEM/etc/build.prop – GNK May 27 '22 at 10:24
  • Compressing system.new.dat with brotli Compressing vendor.new.dat with brotli Compressing product.new.dat with brotli Compressing odm.new.dat with brotli Compressing system_ext.new.dat with brotli write trust now... write uboot now... warning: no vbmeta.img in input target_files; not flashing vbmeta wirte dtbo now... no charge img; ignore it. info: no resource image; ignore it. no RKLoader.bin, ignore it. info: no vendor_boot.img in input target_files; ignore it info: no logo image; ignore it. – GNK May 27 '22 at 10:35
  • You should set AB_OTA_UPDATER to true if you want to use A/B – Yong May 30 '22 at 09:20
0

After you build AOSP code successfully,you must set DIST_DIR as follows:

. build/envsetup.sh && lunch {your_target}
mkdir dist_output
make dist DIST_DIR=dist_output
AnswerZhao
  • 366
  • 3
  • 13
  • Error is coming in next step after giving below command any solution for that? ./build/make/tools/releasetools/ota_from_target_files dist_output/target_files-eng.admin.zip update.zip – Jordon Jan 29 '23 at 18:08