'Failed to generate Android incremental OTA package

Getting error while trying to generate incremental OTA using the following command - ./build/tools/releasetools/ota_from_target_files -i PREVIOUS-msm8953_64-target_files-eng.root.zip NEW-msm8953_64-target_files-eng.root.zip incremental_ota_update.zip after generating target files.

unzipping target target-files...
(using device-specific extensions from target_files)
unzipping source target-files...
loaded device-specific extensions from /tmp/targetfiles-WAy71u/META/releasetools.py
using prebuilt boot.img from IMAGES...
using prebuilt boot.img from IMAGES...
using prebuilt recovery.img from IMAGES...
Total of 786432 4096-byte output blocks in 27 input chunks.
Total of 786432 4096-byte output blocks in 27 input chunks.
Finding transfers...
Generating digraph...
Finding vertex sequence...
Reversing backward edges...
  0/0 dependencies (0.00%) were violated; 0 source blocks stashed.
Improving vertex order...
Revising stash size...
  Total 0 blocks (0 bytes) are packed as new blocks due to insufficient cache size.
Reticulating splines...
      4096       4096 (100.00%)     new __COPY 0
Computing patches (using 12 threads)...
 [100%] __NONZERO-6

ERROR:
Failed to generate imgdiff for //system/app/G4qolsys/G4qolsys.apk: tgt=314217-318509, src=314217-318509:
W/ziparchive(29582): Zip: bad offsets (dir 17461248, size 122968, eocd 17580120)
imgdiff E 03-03 22:00:40 29582 29582 imgdiff.cpp:661] Failed to open zip file /tmp/src-qiUV7M: Invalid offset


Solution 1:[1]

It could be issue when .so file directly integrated in to apk not exported to use the Android.mk reference. Please check in apk does it includes any .so files .

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 praveenk