KVIM3(L) - Android 9 build broken with vcode_m2m already defined

I have been struggling for a few days to get a build going for KVIM3 or KVIM3L devices. I’ve worked through tool dependency issues, but basically it seems i must be missing some step as a full build according to these instructions:
https://docs.khadas.com/vim3/BuildAndroid.html as i get modules being defined multiple times in the build tree.

building following google’s site DOES work (though it produces a build with broken bluetooth which i require): রেফারেন্স বোর্ড ব্যবহার করে  |  Android Open Source Project

here is from this branch:

$ repo init -u GitHub - khadas/android_manifest: AOSP for Khadas VIMs & Edge -b khadas-vims-pie

My build fails pretty quickly with " MODULE.TARGET.EXECUTABLES.vcode_m2m already defined"

Looking at the code, it looks like i may workaround this if i have a prebuilt kernel, but i don’t see any instructions on building it nor copying it into the correct folder of the source tree.

Any help you can give would be greatly appretiated.

Thank you!

tyler@tyler-desktop-ubuntu:~/work/src/spare/aosp_kd$ make -j8 otapackage
hardware/amlogic/wifi/configs/wifi.mk:43: warning: WIFI_MOUDLE is multiwifi
hardware/amlogic/wifi/configs/wifi.mk:47: warning: WIFI_BUILD_IN is false
hardware/amlogic/bluetooth/configs/bluetooth.mk:20: warning: BLUETOOTH_MODULE is BCMBT
hardware/amlogic/bluetooth/configs/bluetooth.mk:24: warning: BLUETOOTH_INF is not set

PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=9
TARGET_PRODUCT=kvim3
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=cortex-a9
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-5.8.0-55-generic-x86_64-Ubuntu-20.04.2-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=PPR1.180610.011
OUT_DIR=/home/tyler/work/src/aosp/out/aosp_kd

ninja: no work to do.
ninja: no work to do.
device/khadas/kvim3/preinstall/preinstall.mk was modified, regenerating…
hardware/amlogic/wifi/configs/wifi.mk:43: warning: WIFI_MOUDLE is multiwifi
hardware/amlogic/wifi/configs/wifi.mk:47: warning: WIFI_BUILD_IN is false
hardware/amlogic/bluetooth/configs/bluetooth.mk:20: warning: BLUETOOTH_MODULE is BCMBT
hardware/amlogic/bluetooth/configs/bluetooth.mk:24: warning: BLUETOOTH_INF is not set
/home/tyler/work/src/aosp/out/aosp_kd/build-kvim3.ninja is missing, regenerating…
hardware/amlogic/wifi/configs/wifi.mk:43: warning: WIFI_MOUDLE is multiwifi
hardware/amlogic/wifi/configs/wifi.mk:47: warning: WIFI_BUILD_IN is false
hardware/amlogic/bluetooth/configs/bluetooth.mk:20: warning: BLUETOOTH_MODULE is BCMBT
hardware/amlogic/bluetooth/configs/bluetooth.mk:24: warning: BLUETOOTH_INF is not set
[5/955] including build/make/Android.mk …
device/khadas/common/factory.mk:184: warning: echo “radio add dt and bootloader”
device/khadas/common/factory.mk:322: warning: will keep /home/tyler/work/src/aosp/out/aosp_kd/target/product/kvim3/update.img
device/khadas/common/factory.mk:465: warning: will keep /home/tyler/work/src/aosp/out/aosp_kd/target/product/kvim3/kvim3-fastboot-flashall-20210621.zip
[314/955] including hardware/amlogic/audio/Android.mk …
“---------ott audio mode, compiler configure 2 channels output by default--------”
[317/955] including hardware/amlogic/camera/Android.mk …
eth0: error fetching interface information: Device not found


pdk or not:
target board: g12b
git version: “620d8d5f125aad285e53c797f48ee0e32fd774fb”
uncomment: 0 files
last changed: “Date: Sat Nov 7 17:50:25 2020 +0800”
build time: " Mon Jun 21 16:34:16 PDT 2021"
builder name: " tyler"
branch name: “* likewise”
build mode: userdebug
host name: “tyler-desktop-ubuntu”
eth0: error fetching interface information: Device not found
host IP: “”
path: “/home/tyler/work/src/spare/aosp_kd/hardware/amlogic/camera/v3/fake-pipeline2/tests”


[321/955] including hardware/amlogic/gralloc/Android.mk …
hardware/amlogic/gralloc/Android.mk:79: warning: “the value of GPU_ARCH is bifrost”
hardware/amlogic/gralloc/Android.mk:135: warning: “the value of BOARD_RESOLUTION_RATIO is 1080”
hardware/amlogic/gralloc/Android.mk:141: warning: “the value of HWC_PRIMARY_DISP_SUPPORT_AFBC is false”
hardware/amlogic/gralloc/Android.mk:142: warning: “the value of HWC_EXTEND_DISP_SUPPORT_AFBC is true”
hardware/amlogic/gralloc/Android.mk:154: warning: “the value of GPU_TYPE is gondul”
[323/955] including hardware/amlogic/hwcomposer/Android.mk …
“Build HWC 2.0”
[360/955] including home/tyler/work/src/aosp/out/aosp_kd/target/product/kvim3l/obj/media_modules/amvdec_ports/test/Android.mk …
build/make/core/base_rules.mk:260: error: home/tyler/work/src/aosp/out/aosp_kd/target/product/kvim3l/obj/media_modules/amvdec_ports/test: MODULE.TARGET.EXECUTABLES.vcode_m2m already defined by home/tyler/work/src/aosp/out/aosp_kd/target/product/kvim3/obj/media_modules/amvdec_ports/test.
16:34:17 ckati failed with: exit status 1

failed to build some targets (16 seconds)

@Tyler_Carper i found that you build the kvim3 and kvim3l at the same time , you can try to rm out folder and rebuild

ah, that could be it - thank you.

I’ll give that a try over the next couple hours and let you know. does the default repo sync for pie include both and it is expected to delete one? or did i somehow get my build environment wrong?

Thank you very much for the help

root@lxx-NUC10i7FNH:/home/lxx/Downloads/android_khadas#
root@lxx-NUC10i7FNH:/home/lxx/Downloads/android_khadas# make otapackage -j10
hardware/amlogic/wifi/configs/wifi.mk:43: warning: WIFI_MOUDLE is multiwifi
hardware/amlogic/wifi/configs/wifi.mk:47: warning: WIFI_BUILD_IN is false
hardware/amlogic/bluetooth/configs/bluetooth.mk:20: warning: BLUETOOTH_MODULE is BCMBT
hardware/amlogic/bluetooth/configs/bluetooth.mk:24: warning: BLUETOOTH_INF is not set

PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=9
TARGET_PRODUCT=kvim3
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=cortex-a9
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-5.4.0-74-generic-x86_64-Ubuntu-18.04.4-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=PPR1.180610.011
OUT_DIR=out

maybe your OUT_DIR is unnormal,you can check it

2 Likes

:flushed:

That has to be it… i normally build in zsh, but when the env instructions said to use bash i swapped not remembering i had an old .bash_profile that was setting OUT_DIR_COMMON_BASE to an old environment

Thank you so much for helping so quickly! You’re a life saver!

1 Like

Thank you so much for the help. Build successful!

one last issue i’m hoping you can help me with… i’m trying to build an ATV build of pie (similar to the S build) rather than the tablet version.

are there any instructions to do that anywhere?

Thanks again!

actually i found the answer to my last question.

added this to the manifest at the revision id from google’s pie-release-2 tag:
<project path="device/google/atv" remote="aosp" name="device/google/atv" revision="901e95ac968d961ddbbf47bd2e0ec71ccda1711b" />

did a repo sync and then built with:

make TARGET_BUILD_GOOGLE_ATV=true -j24 otapackage

don’t have all the atv apps yet, but the system build to acknowledge itself as an android tv.

Thanks again for all your help!