[Android Q&A, Help & Troubleshooting] s0f0s:
Yes, it solves revision issues. But the problem with gps remains

$ brunch omni_z3-eng
including device/generic/uml/vendorsetup.sh
including device/google/muskie/vendorsetup.sh
including device/google/taimen/vendorsetup.sh
including device/oneplus/oneplus5t/vendorsetup.sh
including device/oneplus/oneplus5/vendorsetup.sh
including device/sony/z2/vendorsetup.sh
including device/sony/z3c/vendorsetup.sh
including device/sony/z3/vendorsetup.sh
Looking for dependencies on: device/sony/shinano-common
Looking for dependencies on: device/sony/msm8974-common

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=8.1.0
TARGET_PRODUCT=omni_z3
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_PLATFORM_VERSION=OPM1
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=krait
TARGET_2ND_ARCH=
TARGET_2ND_ARCH_VARIANT=
TARGET_2ND_CPU_VARIANT=
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.13.0-21-generic-x86_64-with-Ubuntu-17.10-artful
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=OPM3.171019.013
OUT_DIR=/home/user/Android/roms/OmniROM/8.1/out
AUX_OS_VARIANT_LIST=
============================================
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=8.1.0
TARGET_PRODUCT=omni_z3
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=krait
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.13.0-21-generic-x86_64-with-Ubuntu-17.10-artful
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=OPM3.171019.013
OUT_DIR=/home/user/Android/roms/OmniROM/8.1/out
============================================
[44/44] bootstrap /home/user/Android/r...ut/soong/.minibootstrap/build.ninja.in
[4/4] /home/user/Android/roms/OmniROM/...M/8.1/out/soong/.bootstrap/build.ninja
[871/872] glob vendor/*/*/*/*/*/*/Android.bp
[54/54] /home/user/Android/roms/OmniRO...roms/OmniROM/8.1/out/soong/build.ninja
/home/user/Android/roms/OmniROM/8.1/out/build-omni_z3.ninja is missing, regenerating...
[120/999] including ./device/sony/msm8974-common/Android.mk ...
device-sony-common-init: init_sony for "z3", platform "shinano", with ' -DDEV_BLOCK_FOTA_NUM="16" -DDEV_BLOCK_FOTA_MAJOR="179" -DDEV_BLOCK_FOTA_MINOR="16" -DFOTA_RAMDISK_CHECK="0" -DKEYCHECK_ENABLED="1" -DKEYCHECK_NO_DOWN="1"'
[464/999] including ./hardware/qcom/gps/Android.mk ...
build/core/base_rules.mk:238: error: hardware/qcom/gps/core: MODULE.TARGET.SHARED_LIBRARIES.libloc_core already defined by hardware/qcom/gps/sdm845/core.
02:00:32 ckati failed with: exit status 1

#### failed to build some targets (01:06 (mm:ss)) ####

real	1m5,548s
user	1m57,410s
sys	0m7,823s

but why the "hardware/qcom/gps/Android.mk" is included later? This file do not have section for msm8974 platform and thus includes some default stuff which conflicts with sdm845. If I exclude that default stuff then again I get missing keystore.msm8974 error

$ brunch omni_z3-eng
including device/generic/uml/vendorsetup.sh
including device/google/muskie/vendorsetup.sh
including device/google/taimen/vendorsetup.sh
including device/oneplus/oneplus5t/vendorsetup.sh
including device/oneplus/oneplus5/vendorsetup.sh
including device/sony/z2/vendorsetup.sh
including device/sony/z3c/vendorsetup.sh
including device/sony/z3/vendorsetup.sh
Looking for dependencies on: device/sony/shinano-common
Looking for dependencies on: device/sony/msm8974-common

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=8.1.0
TARGET_PRODUCT=omni_z3
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_PLATFORM_VERSION=OPM1
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=krait
TARGET_2ND_ARCH=
TARGET_2ND_ARCH_VARIANT=
TARGET_2ND_CPU_VARIANT=
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.13.0-21-generic-x86_64-with-Ubuntu-17.10-artful
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=OPM3.171019.013
OUT_DIR=/home/user/Android/roms/OmniROM/8.1/out
AUX_OS_VARIANT_LIST=
============================================
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=8.1.0
TARGET_PRODUCT=omni_z3
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=krait
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.13.0-21-generic-x86_64-with-Ubuntu-17.10-artful
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=OPM3.171019.013
OUT_DIR=/home/user/Android/roms/OmniROM/8.1/out
============================================
ninja: no work to do.
ninja: no work to do.
./hardware/qcom/gps/Android.mk was modified, regenerating...
[120/999] including ./device/sony/msm8974-common/Android.mk ...
device-sony-common-init: init_sony for "z3", platform "shinano", with ' -DDEV_BLOCK_FOTA_NUM="16" -DDEV_BLOCK_FOTA_MAJOR="179" -DDEV_BLOCK_FOTA_MINOR="16" -DFOTA_RAMDISK_CHECK="0" -DKEYCHECK_ENABLED="1" -DKEYCHECK_NO_DOWN="1"'
[999/999] including ./vendor/sony/shinano-common-caf/proprietary/Android.mk ...
PRODUCT_COPY_FILES frameworks/base/data/sounds/effects/ogg/VideoRecord_48k.ogg:system/media/audio/ui/VideoRecord.ogg ignored.
PRODUCT_COPY_FILES frameworks/base/data/sounds/effects/ogg/VideoStop_48k.ogg:system/media/audio/ui/VideoStop.ogg ignored.
PRODUCT_COPY_FILES frameworks/base/data/sounds/effects/ogg/camera_click_48k.ogg:system/media/audio/ui/camera_click.ogg ignored.
[B]No private recovery resources for TARGET_DEVICE z3[/B]
Using '/home/user/Android/roms/OmniROM/8.1/prebuilts/misc/linux-x86/ccache/ccache' binary on 'linux-x86'
platform_testing/build/tasks/tests/instrumentation_metric_test_list.mk: warning: continuous_instrumentation_metric_tests: Unknown installed file for module perf-setup.sh
platform_testing/build/tasks/tests/instrumentation_test_list.mk: warning: continuous_instrumentation_tests: Unknown installed file for module RecyclerViewTests
platform_testing/build/tasks/tests/instrumentation_test_list.mk: warning: continuous_instrumentation_tests: Unknown installed file for module SettingsFunctionalTests
platform_testing/build/tasks/tests/instrumentation_test_list.mk: warning: continuous_instrumentation_tests: Unknown installed file for module LauncherFunctionalTests
platform_testing/build/tasks/tests/instrumentation_test_list.mk: warning: continuous_instrumentation_tests: Unknown installed file for module EmergencyInfoTests
platform_testing/build/tasks/tests/native_metric_test_list.mk: warning: continuous_native_metric_tests: Unknown installed file for module perf-setup.sh
build/core/base_rules.mk:390: warning: overriding commands for target `/home/user/Android/roms/OmniROM/8.1/out/target/product/z3/root/res/images/charger/battery_fail.png'
build/core/base_rules.mk:390: warning: ignoring old commands for target `/home/user/Android/roms/OmniROM/8.1/out/target/product/z3/root/res/images/charger/battery_fail.png'
build/core/base_rules.mk:390: warning: overriding commands for target `/home/user/Android/roms/OmniROM/8.1/out/target/product/z3/root/res/images/charger/battery_scale.png'
build/core/base_rules.mk:390: warning: ignoring old commands for target `/home/user/Android/roms/OmniROM/8.1/out/target/product/z3/root/res/images/charger/battery_scale.png'
build/core/Makefile:34: warning: overriding commands for target `/home/user/Android/roms/OmniROM/8.1/out/target/product/z3/system/lib/libGLESv1_CM.so'
build/core/base_rules.mk:390: warning: ignoring old commands for target `/home/user/Android/roms/OmniROM/8.1/out/target/product/z3/system/lib/libGLESv1_CM.so'
build/core/Makefile:34: warning: overriding commands for target `/home/user/Android/roms/OmniROM/8.1/out/target/product/z3/system/lib/libGLESv2.so'
build/core/base_rules.mk:390: warning: ignoring old commands for target `/home/user/Android/roms/OmniROM/8.1/out/target/product/z3/system/lib/libGLESv2.so'
build/core/Makefile:34: warning: overriding commands for target `/home/user/Android/roms/OmniROM/8.1/out/target/product/z3/system/lib/libGLESv3.so'
build/core/base_rules.mk:390: warning: ignoring old commands for target `/home/user/Android/roms/OmniROM/8.1/out/target/product/z3/system/lib/libGLESv3.so'
build/core/Makefile:34: warning: overriding commands for target `/home/user/Android/roms/OmniROM/8.1/out/target/product/z3/system/vendor/lib/libta.so'
build/core/base_rules.mk:390: warning: ignoring old commands for target `/home/user/Android/roms/OmniROM/8.1/out/target/product/z3/system/vendor/lib/libta.so'
build/core/Makefile:34: warning: overriding commands for target `/home/user/Android/roms/OmniROM/8.1/out/target/product/z3/system/vendor/lib/mediadrm/libdrmclearkeyplugin.so'
build/core/base_rules.mk:390: warning: ignoring old commands for target `/home/user/Android/roms/OmniROM/8.1/out/target/product/z3/system/vendor/lib/mediadrm/libdrmclearkeyplugin.so'
build/core/Makefile:34: warning: overriding commands for target `/home/user/Android/roms/OmniROM/8.1/out/target/product/z3/system/vendor/etc/audio_effects.conf'
build/core/base_rules.mk:390: warning: ignoring old commands for target `/home/user/Android/roms/OmniROM/8.1/out/target/product/z3/system/vendor/etc/audio_effects.conf'
build/core/Makefile:34: warning: overriding commands for target `/home/user/Android/roms/OmniROM/8.1/out/target/product/z3/system/etc/mkshrc'
build/core/base_rules.mk:390: warning: ignoring old commands for target `/home/user/Android/roms/OmniROM/8.1/out/target/product/z3/system/etc/mkshrc'
ninja: error: 'keystore.msm8974', needed by '/home/user/Android/roms/OmniROM/8.1/out/target/product/z3/obj/ETC/twrp.fstab_intermediates/twrp.fstab', missing and no known rule to make it
01:37:23 ninja failed with: exit status 1

#### failed to build some targets (57 seconds) ####

real	0m56,763s
user	0m52,993s
sys	0m4,630s

Note among others this message:

No private recovery resources for TARGET_DEVICE z3

Is it possible that it is somehow connected with missing keystore.msm8974?

Sometimes strange errors may be caused by wrong versions of building environment components (JDK python, etc.) Which are the correct versions?