whatawurst / android_device_sony_yoshino-common

This is the Android device configuration for the yoshino platform
10 stars 48 forks source link

Building 19+ fails due to PRODUCT_BOOT_JARS #89

Closed Flamefire closed 1 year ago

Flamefire commented 1 year ago

I'm having trouble building 19.1 and was wondering if you can help as I think it should be the same issue in 20

So trouble is caused by https://github.com/whatawurst/android_device_sony_yoshino-common/blob/lineage-20/platform/dependencies.mk#L52-L53

With the error

Error: /repo19/soong/.intermediates/device/sony/yoshino-common/hardware/ims/ims-ext-common_system/android_common/aligned/ims-ext-common_system.jar contains class file org.codeaurora.ims.internal.ICrsCrbtController, whose package name "org.codeaurora.ims.internal" is empty or not in the allow list build/soong/scripts/check_boot_jars/package_allowed_list.txt of packages allowed on the bootclasspath.

It refers to this class in a build rule generated by https://github.com/LineageOS/android_build_soong/blob/lineage-19.1/java/boot_jars.go checking the package names against regexs in https://github.com/LineageOS/android_build_soong/blob/lineage-20.0/scripts/check_boot_jars/package_allowed_list.txt and that contains only "org.codeaurora.ims" & "org.codeaurora.internal" which doesn't match "org.codeaurora.ims.internal"

So the error is expected in 19.0, 19.1 and 20.0. How do you avoid it?

BTW: The correct entries are used in other distributions, see e.g. https://gerrit.pixysos.com/c/PixysOS/build_soong/+/23279/2/scripts/check_boot_jars/package_allowed_list.txt

derfelot commented 1 year ago

Weird, I am not hitting this problem on 20, at least not the last time I built.

For 19.1, there seems to be a change up on los gerrit to address this issue: https://review.lineageos.org/c/LineageOS/android_build_soong/+/344315

Flamefire commented 1 year ago

There seems to be an environment variable to disable those checks.

Yep, that's my PR ;-)

Flamefire commented 1 year ago

Interesting reply:

The ims.apk downloaded from whatawurst has the following lines in AndroidManifest:

<uses-library android:name="qti-telephony-hidl-wrapper"/>
<uses-library android:name="qti-telephony-utils"/>
<uses-library android:name="ims-ext-common"/>

You didn't forget to add the following targets to PRODUCT_PACKAGES, did you?

PRODUCT_PACKAGES += ims_ext_common.xml qti_telephony_hidl_wrapper.xml qti_telephony_hidl_wrapper_prd.xml qti_telephony_utils.xml qti_telephony_utils_prd.xml

So it looks like the workaround is no longer required.

derfelot commented 1 year ago

True, with the updated apk from sld_sprout this is probably not needed anymore.

Flamefire commented 1 year ago

I added a revert commit (with resolved conflicts) to my fork which you can cherry-pick: https://github.com/Flamefire/android_device_sony_yoshino-common/commit/dae54c1ca287d18a1daf6a6de6237800d14d8b1d

As far as I can tell the qti_telephony_hidl_wrapper_prd.xml & qti_telephony_utils_prd.xml are not required as the ims.apk is now (again) on the /system_ext not the /product partition. But currently can't test it on a device.

derfelot commented 1 year ago

Picked the revert, IMS still seems to work. THanks