Search code examples
buildandroid-sourceota

AOSP OTA incremental version issue


I am facing an issue with AOSP incremental OTA build. If I do an incremental build (without make clean), build completes fast and I get a smaller OTA file, and OTA updates successfully on the target system; BUT the incremental build number of target system remains same. So next time when another OTA is generated and tried to update, it fails, giving error : "package expects build fingerprint of ../../..//.. ". as, incremental build number is part of build fingerprint.

If I do 'make clean' before 'make dist', things work fine; but build time is much more and OTA file is bloated; many packages which are NOT modified are identified as modified by some %, and is added to OTA.

How to increment build number without 'make clean' ?

Thanks in advance.


Solution

  • The problem is with build fingerprint and it's not updated with the incremental build. I have also faced the same issue with buildfingerprint. Just delete below files before starting the intermental build.

    rm -rf out/target/product/abc123/system/build*
    rm -rf out/target/product/abc123/obj/ETC/system_build_prop_intermediates/
    rm -rf out/target/product/abc123/root/
    rm -rf out/target/product/abc123/*.img
    rm -rf out/target/product/abc123/*.zip
    rm -rf out/target/product/abc123/recovery 
    rm -rf out/target/product/abc123/system/priv-app/
    rm -rf out/target/product/abc123/system/app/
    rm -rf out/target/product/abc123/obj/PACKAGING/target_files_intermediates/
    rm -rf out/target/product/abc123/obj/EXECUTABLES/recovery_*
    rm -rf out/target/product/abc123/obj/PACKAGING/
    rm -rf out/target/product/abc123/obj/KERNEL_OBJ/.config
    

    Note: Replace "abc123" string with the product name.

    Add below changes to override default build.

    build/core/build_id.mk

    ifeq ($(BUILD_ID),)
     export BUILD_ID=NMF26Q
    endif
    

    And set new build id for before starting build.

    export BUILD_ID=123 && source build/envsetup.sh && lunch

    make dist