3

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.

  • I do encounter the same issue but I haven't found a solution for it yet. – xdevs23 Sep 27 '22 at 21:47
  • So adding `$(call inherit-product, build/target/product/gsi_release.mk)` to the target makes the error go away but then I get `build/make/core/artifact_path_requirements.mk:30: warning: build/make/target/product/generic_system.mk produces files outside its artifact path requirement. Allowed paths are root/*, system/*` – xdevs23 Sep 28 '22 at 21:30
  • Although adding `gsi_release.mk` is not really supposed to be the solution. – xdevs23 Sep 28 '22 at 21:41

1 Answers1

3

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/

xdevs23
  • 3,824
  • 3
  • 20
  • 33