Search code examples
androidandroid-soongandroid-13

Failed to build sample SDK add-on on Android 13 AOSP


I'm trying to build my own SDK add-on from scratch, and attempt to comply with the sample in device/sample. Complying to the instructions in README.txt, I got following failure while building:

[100% 1/1] analyzing Android.bp files and generating ninja file at out/soong/build.ninja
FAILED: out/soong/build.ninja
cd "$(dirname "out/host/linux-x86/bin/soong_build")" && BUILDER="$PWD/$(basename "out/host/linux-x86/bin/soong_build")" && cd / && env -i  "$BUILDER"     --top "$TOP"     --soong_o
ut "out/soong"     --out "out"     -o out/soong/build.ninja --globListDir build --globFile out/soong/globs-build.ninja -t -l out/.module_paths/Android.bp.list --available_env out/s
oong/soong.environment.available --used_env out/soong/soong.environment.used.build Android.bp
error: prebuilts/module_sdk/conscrypt/current/Android.bp:20:1: dependency "art-bootclasspath-fragment" of "conscrypt-module-sdk_com.android.conscrypt-bootclasspath-fragment@current
" missing variant:
  apex:com.android.art
available variants:
  os:android,arch:common
error: prebuilts/module_sdk/conscrypt/current/Android.bp:20:1: dependency "prebuilt_art-bootclasspath-fragment" of "conscrypt-module-sdk_com.android.conscrypt-bootclasspath-fragmen
t@current" missing variant:
  apex:com.android.art
available variants:
  os:android,arch:common
10:34:20 soong bootstrap failed with: exit status 1

Does anyone encounter the same issue? It would be appriciated if there's any workaround on this. Thanks.


Solution

  • Edit build/make/target/product/sdk_phone_x86_64.mk (or your device target file) and add following line at the end:

    MODULE_BUILD_FROM_SOURCE := true
    

    For me, that solved the error and the build now starts.

    You can view my product repository (you can drop it in your source tree and use lunch aosp_sdk_phone_x86_64-eng) to have this change as well:

    https://git.halogenos.org/halogenOS/android_product_halogenOS/