Search code examples
androidandroid-source

AOSP Build Error: The following instances are in the device manifest but not specified in framework compatibility matrix


i am trying to create an Stable AIDL HAL service. I am following example from the link below.

Link to Stable AIDL tutorial

I followed all the steps mentioned in tutorial, but for some reason, my build fails with error "The following instances are in the device manifest but not specified in framework compatibility matrix"

I already added compatibility matrix in my source code. I am not able to figure out whats wrong with the below xml. Can someone share what could be the issue? any pointers to resolve this?

<?xml version="1.0" encoding="UTF-8"?>
<!-- Comments, Legal notices, etc. here -->
<compatibility-matrix version="1.0" type="framework">
<hal format="aidl" optional="true">
     <name>android.hardware.invcase</name>
     <version>1</version>
     <interface>
         <name>IInvcase</name>
         <instance>default</instance>
     </interface>
</hal>
</compatibility-matrix>

This is the complete error.

ERROR: files are incompatible: The following instances are in the device manifest but not specified in framework compatibility matrix: 
    android.hardware.invcase.IInvcase/default (@1)
Suggested fix:
1. Update deprecated HALs to the latest version.
2. Check for any typos in device manifest or framework compatibility matrices with FCM version >= 8.
3. For new platform HALs, add them to any framework compatibility matrix with FCM version >= 8 where applicable.
4. For device-specific HALs, add to DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE or DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE.: Success
INCOMPATIBLE
19:44:38 ninja failed with: exit status 1

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


Solution

  • Where does your device framework compatibility matrix XML file live and is your device mk file pointing to it?

    If your XML file is named: custom_framework_compatibility_matrix.xml for example then you might be missing the following line in your device mk file (usually the device mk file is located some place like device/<your_company>/<your_device>/<your_device>.mk):

    Here is the line needed in your device mk file:

    DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE += \
        device/<your_company>/<your_device>/custom_framework_compatibility_matrix.xml
    

    Replace your_company and your_device to match the paths for your AOSP build.

    Now the Android framework should know about the new HAL you have created.

    This aspect of HAL development is very poorly documented on source.android.com at this time IMO. The codeinsideout blog link is a pretty good resource but missing a description of this particular file.