sonyxperiadev/bug_tracker

Building AOSP 13 Fails due to Missing Audio Packages

Closed this issue · 15 comments

Platform: Sagami
Device: PDX215
Kernel version: 5.4
Android version: 13
Software binaries version: Latest

Description
audio.a2dp.default is now part of the bluetooth mainline module (https://source.android.com/docs/core/architecture/modular-system), and cannot be installed independently.

In device/sony/common/common-packages:

Audio

PRODUCT_PACKAGES +=
audio.a2dp.default
audio.bluetooth.default
audio.hearing_aid.default
audio.r_submix.default
audio.usb.default
libaudio-resampler

Remove audio.a2dp.default \ and audio.hearing_aid.default \

Symptoms
[ 93% 538/576] including system/sepolicy/Android.mk ... system/sepolicy/Android.mk:57: warning: BOARD_PLAT_PUBLIC_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS instead. system/sepolicy/Android.mk:62: warning: BOARD_PLAT_PRIVATE_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS instead. [ 0% 1165/158736] build out/NOT_AVAILABLE_FOR_PLATFORM/target/product/pdx215/system/lib64/hw/audio.a2dp.default.so FAILED: out/NOT_AVAILABLE_FOR_PLATFORM/target/product/pdx215/system/lib64/hw/audio.a2dp.default.so /bin/bash -c "(echo -e \"\\033[1maudio.a2dp.default: \\033[31merror:\\033[0m\\033[1m\" 'Module is requested to be installed but is not available for platform because it does not have \"//apex_available:platform\" or it depends on other modules that are not available for platform.' \"\\033[0m\" >&2 ) && (exit 1 )" audio.a2dp.default: error: Module is requested to be installed but is not available for platform because it does not have "//apex_available:platform" or it depends on other modules that are not available for platform. [ 0% 1166/158736] build out/NOT_AVAILABLE_FOR_PLATFORM/target/product/pdx215/system/lib/hw/audio.a2dp.default.so FAILED: out/NOT_AVAILABLE_FOR_PLATFORM/target/product/pdx215/system/lib/hw/audio.a2dp.default.so /bin/bash -c "(echo -e \"\\033[1maudio.a2dp.default_32: \\033[31merror:\\033[0m\\033[1m\" 'Module is requested to be installed but is not available for platform because it does not have \"//apex_available:platform\" or it depends on other modules that are not available for platform.' \"\\033[0m\" >&2 ) && (exit 1 )" audio.a2dp.default_32: error: Module is requested to be installed but is not available for platform because it does not have "//apex_available:platform" or it depends on other modules that are not available for platform. [ 0% 1167/158736] build out/NOT_AVAILABLE_FOR_PLATFORM/target/product/pdx215/system/lib64/hw/audio.hearing_aid.default.so FAILED: out/NOT_AVAILABLE_FOR_PLATFORM/target/product/pdx215/system/lib64/hw/audio.hearing_aid.default.so /bin/bash -c "(echo -e \"\\033[1maudio.hearing_aid.default: \\033[31merror:\\033[0m\\033[1m\" 'Module is requested to be installed but is not available for platform because it does not have \"//apex_available:platform\" or it depends on other modules that are not available for platform.' \"\\033[0m\" >&2 ) && (exit 1 )" audio.hearing_aid.default: error: Module is requested to be installed but is not available for platform because it does not have "//apex_available:platform" or it depends on other modules that are not available for platform. [ 0% 1168/158736] build out/NOT_AVAILABLE_FOR_PLATFORM/target/product/pdx215/system/lib/hw/audio.hearing_aid.default.so FAILED: out/NOT_AVAILABLE_FOR_PLATFORM/target/product/pdx215/system/lib/hw/audio.hearing_aid.default.so /bin/bash -c "(echo -e \"\\033[1maudio.hearing_aid.default_32: \\033[31merror:\\033[0m\\033[1m\" 'Module is requested to be installed but is not available for platform because it does not have \"//apex_available:platform\" or it depends on other modules that are not available for platform.' \"\\033[0m\" >&2 ) && (exit 1 )" audio.hearing_aid.default_32: error: Module is requested to be installed but is not available for platform because it does not have "//apex_available:platform" or it depends on other modules that are not available for platform. 00:52:09 ninja failed with: exit status 1

How to reproduce
Build AOSP

Did you run repo_update.sh?

It should be fixed with sonyxperiadev/repo_update@3f90fdc

Yep, Always...
After removing the Packages everything built fine. I synced Android 13 R4 Clean with Clean local_manifests and No edits...

I dont See why Apex shouldnt be updateable because the Error is Like Said based on The Mainline Implementation in Android 13.

Sadly I've got the same problem and can't build AOSP 13 for TAMA AKARI with first time checked out code on this machine.

build/make/core/tasks/platform_availability_check.mk:37: warning:  Following modules are requested to be installed. But are not available for platform because they do not have 
"//apex_available:platform" or they depend on other modules that are not available for platform
Offending entries:
audio.a2dp.default:packages/modules/Bluetooth/system/audio_a2dp_hw
audio.a2dp.default_32:packages/modules/Bluetooth/system/audio_a2dp_hw
audio.hearing_aid.default:packages/modules/Bluetooth/system/audio_hearing_aid_hw
audio.hearing_aid.default_32:packages/modules/Bluetooth/system/audio_hearing_aid_hw
In file included from build/make/core/main.mk:1448:
In file included from build/make/core/Makefile:6951:
build/make/core/tasks/platform_availability_check.mk:37: error: Build failed.

@MartinX3 A solution was provided above, have you even tried it?

You mean removing the packages like @Miustone said?
The commit in the repo_update.sh doesn't work.

The commit in the repo_update.sh doesn't work.

...?

The commit in the repo_update.sh doesn't work.

...?

What exactly should I try?

Clarify what about the last commit is not working... Since it has been working for everyone thus far? Did you make sure that it was properly applied in your tree? Or does it not apply anymore?

The linked commit does apply.
It just doesn't compile.

The tree is clean.
Fresh synced on a virgin storage.

The linked commit does apply. It just doesn't compile.

The tree is clean. Fresh synced on a virgin storage.

In device/sony/common/common-packages:

Audio
PRODUCT_PACKAGES +=
audio.a2dp.default
audio.bluetooth.default
audio.hearing_aid.default
audio.r_submix.default
audio.usb.default
libaudio-resampler

Remove audio.a2dp.default \ and audio.hearing_aid.default \

!?

@MartinX3 you're saying two conflicting things now:

  1. The patch does not apply (so what did you do? Fix the conflicts? Skip it altogether?)
  2. "it" doesn't compile (with conflict markers? It obviously doesn't build without the mandatory patch).

Regardless, the obvious and proper fix is of course sonyxperiadev/device-sony-common#899, but that still requires more config cleanup in device/platform repos, not to mention the device I tested on not having working A2DP audio at all...

It """"" DOES """" apply...

Reading bug on my end then; even if it makes no sense 😉 - that patch is supposed to readd "//apex_available:platform" to exactly the packages listed in the error, or did I misremember that as well?

tldr: sonyxperiadev/device-sony-common#899 is now merged, and that takes care of this

Longer version:
I can confirm the repo_update revert is not enough.
Despite the revert adding "//apex_available:platform" back to both the modules, the build error is still fired, probably because some component down the dependency chain is not available to platform, as suggested by the error message itself.

I also tried adding that property to all apex in packages/modules/Bluetooth, it didn't help, so the problem is likely somewhere else.

In any case, sonyxperiadev/device-sony-common#899 is now merged, and that takes care of this.
Please note that PR needs to be complemented by device repo changes, like sonyxperiadev/device-sony-sagami#16

all patches are merged now