Building Lineage OS: Device manifest and framework compatibility matrix are incompatible

5.1k Views Asked by At

I am trying to build Lineage OS for the A52 4G, I'm at the building step, and then the compiler exits because Device manifest and framework compatibility matrix are incompatible.

I tried reading the Android docs about matching rules and device manifest but I didn't really understand how to fix the error, I also tried recompiling and of course it didn't work.

How can I fix this? The full error log:

--kernel out/target/product/a52q/obj/PACKAGING/check_vintf_all_intermediates/kernel_version.txt:out/target/product/a52q/obj/PACKAGING/check_vintf_all_intermediates/kernel_configs.txt --dirmap /system:out/target/product/a52q/system --dirmap /vendor:out/target/product/a52q/vendor --dirmap /odm:out/target/product/a52q/odm --dirmap /product:out/target/product/a52q/product --dirmap /system_ext:out/target/product/a52q/system/system_ext  --property ro.product.first_api_level=30
For ODM SKU = EMPTY_ODM_SKU_PLACEHOLDER, vendor SKU = EMPTY_VENDOR_SKU_PLACEHOLDER
checkvintf I 04-02 04:47:47 119521 119521 check_vintf.cpp:241] Cannot parse "out/target/product/a52q/obj/PACKAGING/check_vintf_all_intermediates/kernel_version.txt" as kernel version, parsing as GKI kernel release.
checkvintf I 04-02 04:47:47 119521 119521 check_vintf.cpp:251] Cannot parse "out/target/product/a52q/obj/PACKAGING/check_vintf_all_intermediates/kernel_version.txt" as GKI kernel release, parsing as kernel release
checkvintf I 04-02 04:47:47 119521 119521 check_vintf.cpp:261] Cannot parse "out/target/product/a52q/obj/PACKAGING/check_vintf_all_intermediates/kernel_version.txt" as kernel release
checkvintf I 04-02 04:47:47 119521 119521 check_vintf.cpp:241] Cannot parse "4.14.190-perf" as kernel version, parsing as GKI kernel release.
checkvintf I 04-02 04:47:47 119521 119521 check_vintf.cpp:251] Cannot parse "4.14.190-perf" as GKI kernel release, parsing as kernel release
checkvintf I 04-02 04:47:47 119521 119521 check_vintf.cpp:278] Successfully parsed content of out/target/product/a52q/obj/PACKAGING/check_vintf_all_intermediates/kernel_version.txt: 4.14.190-perf
checkvintf I 04-02 04:47:47 119521 119521 VintfObject.cpp:58] getFrameworkHalManifest: Reading VINTF information.
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/etc/vintf/manifest.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:54] List 'out/target/product/a52q/system/etc/vintf/manifest/': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/etc/vintf/manifest/[email protected]': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/etc/vintf/manifest/manifest_media_c2_software.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/etc/vintf/manifest/android.system.keystore2-service.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/etc/vintf/manifest/[email protected]': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/etc/vintf/manifest/[email protected]': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/etc/vintf/manifest/[email protected]': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/product/etc/vintf/manifest.xml': NAME_NOT_FOUND
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:54] List 'out/target/product/a52q/product/etc/vintf/manifest/': NAME_NOT_FOUND
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/system_ext/etc/vintf/manifest.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:54] List 'out/target/product/a52q/system/system_ext/etc/vintf/manifest/': NAME_NOT_FOUND
checkvintf I 04-02 04:47:47 119521 119521 VintfObject.cpp:58] getDeviceHalManifest: Reading VINTF information.
checkvintf I 04-02 04:47:47 119521 119521 check_vintf.cpp:79] Sysprop ro.boot.product.vendor.sku=
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/vendor/etc/vintf/manifest.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:54] List 'out/target/product/a52q/vendor/etc/vintf/manifest/': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/vendor/etc/vintf/manifest/[email protected]': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/vendor/etc/vintf/manifest/[email protected]': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/vendor/etc/vintf/manifest/[email protected]': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/vendor/etc/vintf/manifest/[email protected]': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/vendor/etc/vintf/manifest/[email protected]': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/vendor/etc/vintf/manifest/vendor.qti.hardware.display.allocator-service.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/vendor/etc/vintf/manifest/[email protected]': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/vendor/etc/vintf/manifest/android.hardware.graphics.composer-qti-display.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/vendor/etc/vintf/manifest/[email protected]': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/vendor/etc/vintf/manifest/[email protected]': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/vendor/etc/vintf/manifest/android.hardware.graphics.mapper-impl-qti-display.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/vendor/etc/vintf/manifest/android.hardware.wifi.supplicant.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/vendor/etc/vintf/manifest/[email protected]': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/vendor/etc/vintf/manifest/[email protected]': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/vendor/etc/vintf/manifest/android.hardware.vibrator-service.sm7125.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/vendor/etc/vintf/manifest/android.hardware.wifi.hostapd.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/vendor/etc/vintf/manifest/vendor.samsung.hardware.biometrics.fingerprint@3.0-service.sm7125.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 check_vintf.cpp:79] Sysprop ro.boot.product.hardware.sku=
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/odm/etc/vintf/manifest.xml': NAME_NOT_FOUND
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/odm/etc/manifest.xml': NAME_NOT_FOUND
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:54] List 'out/target/product/a52q/odm/etc/vintf/manifest/': NAME_NOT_FOUND
checkvintf I 04-02 04:47:47 119521 119521 VintfObject.cpp:64] getDeviceHalManifest: Successfully processed VINTF information
checkvintf I 04-02 04:47:47 119521 119521 VintfObject.cpp:64] getFrameworkHalManifest: Successfully processed VINTF information
checkvintf I 04-02 04:47:47 119521 119521 VintfObject.cpp:58] getFrameworkCompatibilityMatrix: Reading VINTF information.
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:54] List 'out/target/product/a52q/system/etc/vintf/': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/etc/vintf/compatibility_matrix.6.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/etc/vintf/compatibility_matrix.4.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/etc/vintf/compatibility_matrix.device.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/etc/vintf/manifest.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/etc/vintf/compatibility_matrix.3.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/etc/vintf/compatibility_matrix.5.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:54] List 'out/target/product/a52q/system/system_ext/etc/vintf/': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/system_ext/etc/vintf/manifest.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:54] List 'out/target/product/a52q/product/etc/vintf/': NAME_NOT_FOUND
checkvintf I 04-02 04:47:47 119521 119521 VintfObject.cpp:64] getFrameworkCompatibilityMatrix: Successfully processed VINTF information
checkvintf I 04-02 04:47:47 119521 119521 VintfObject.cpp:58] getDeviceCompatibilityMatrix: Reading VINTF information.
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/vendor/etc/vintf/compatibility_matrix.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 VintfObject.cpp:64] getDeviceCompatibilityMatrix: Successfully processed VINTF information
checkvintf I 04-02 04:47:47 119521 119521 check_vintf.cpp:112] fetched kernel version 4.14.190
checkvintf I 04-02 04:47:47 119521 119521 check_vintf.cpp:116] fetched kernel level from RuntimeInfo ''
checkvintf I 04-02 04:47:47 119521 119521 check_vintf.cpp:130] read kernel configs from out/target/product/a52q/obj/PACKAGING/check_vintf_all_intermediates/kernel_configs.txt
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:54] List 'out/target/product/a52q/system/etc/vintf/': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/etc/vintf/compatibility_matrix.6.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/etc/vintf/compatibility_matrix.4.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/etc/vintf/compatibility_matrix.device.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/etc/vintf/manifest.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/etc/vintf/compatibility_matrix.3.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/etc/vintf/compatibility_matrix.5.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:54] List 'out/target/product/a52q/system/system_ext/etc/vintf/': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/system_ext/etc/vintf/manifest.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:54] List 'out/target/product/a52q/product/etc/vintf/': NAME_NOT_FOUND
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:54] List 'out/target/product/a52q/system/etc/vintf/': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/etc/vintf/compatibility_matrix.6.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/etc/vintf/compatibility_matrix.4.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/etc/vintf/compatibility_matrix.device.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/etc/vintf/manifest.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/etc/vintf/compatibility_matrix.3.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/etc/vintf/compatibility_matrix.5.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:54] List 'out/target/product/a52q/system/system_ext/etc/vintf/': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/system_ext/etc/vintf/manifest.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:54] List 'out/target/product/a52q/product/etc/vintf/': NAME_NOT_FOUND
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:54] List 'out/target/product/a52q/system/etc/vintf/': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/etc/vintf/compatibility_matrix.6.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/etc/vintf/compatibility_matrix.4.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/etc/vintf/compatibility_matrix.device.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/etc/vintf/manifest.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/etc/vintf/compatibility_matrix.3.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/etc/vintf/compatibility_matrix.5.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:54] List 'out/target/product/a52q/system/system_ext/etc/vintf/': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:43] Fetch 'out/target/product/a52q/system/system_ext/etc/vintf/manifest.xml': OK
checkvintf I 04-02 04:47:47 119521 119521 HostFileSystem.cpp:54] List 'out/target/product/a52q/product/etc/vintf/': NAME_NOT_FOUND
checkvintf I 04-02 04:47:47 119521 119521 check_vintf.cpp:384] All HALs in device manifest are declared in FCM <= level 5
checkvintf E 04-02 04:47:47 119521 119521 check_vintf.cpp:620] files are incompatible: Device manifest and framework compatibility matrix are incompatible: HALs incompatible. Matrix level = 5. Manifest level = 5. The following requirements are not met:
checkvintf E 04-02 04:47:47 119521 119521 check_vintf.cpp:620] android.hardware.power:
checkvintf E 04-02 04:47:47 119521 119521 check_vintf.cpp:620]     required: IPower/default (@1-2)
checkvintf E 04-02 04:47:47 119521 119521 check_vintf.cpp:620]     provided:
checkvintf E 04-02 04:47:47 119521 119521 check_vintf.cpp:620] : Success
INCOMPATIBLE
2

There are 2 best solutions below

0
On

Caveat I just started working in this area recently...

Project treble dictates that the vendor (aka device) and system (aka framework) agree on the HALs required.

The crux of the problem appears to be that IPower HAL is required by the framework but not provided by the device.

android.hardware.power:
    required: IPower/default (@1-2)
    provided:

It appears your vendor and system are both compatibility level 5 which is fine but the compatibility_matrix.5.xml file contains the following section:

<hal format="aidl" optional="false">
    <name>android.hardware.power</name>
    <interface>
        <name>IPower</name>
        <instance>default</instance>
    </interface>
</hal>

I'm not clear on why it decided that version 1 through 2 is required, my copy of compatibility_matrix.5.xml doesn't have a version specified as shown above which means per https://source.android.com/docs/core/architecture/vintf/comp-matrices that it defaults to 1.

Since the android.hardware.power::IPower HAL is not optional your vendor manifest needs to declare it and your vendor implementation needs to have it.

Oddly though Google appears to have changed these files recently to make everything optional in compatibility_matrix.5.xml, see:

https://cs.android.com/android/_/android/platform/hardware/interfaces/+/79ed41b0e6a8646c894904942f0c4af32bfac8dc

So one possibility is to the modify the hardware/interfaces/compatibility_matrices/compatibility_matrix.5.xml file and make it optional="true" and see if the system runs anyway.

0
On

device manifest file must have at least target-level=6 API to match the framework compatibility:

./LINUX/android/device/samsung/a52q/manifest.xml:28:

<manifest version="1.0" type="device" target-level="6">