【问题标题】:AOSP Build Error - error: found ELF prebuilt in PRODUCT_COPY_FILES, use cc_prebuilt_binary / cc_prebuilt_library_shared insteadAOSP 构建错误 - 错误:在 PRODUCT_COPY_FILES 中发现 ELF 预构建,请改用 cc_prebuilt_binary / cc_prebuilt_library_shared
【发布时间】:2020-06-17 02:43:58
【问题描述】:

我正在尝试将 Android Q 用户调试版本从我的 mac 电脑刷入我的 Pixel2 XL 设备,但它失败并显示以下错误消息。

[ 27% 31880/114806] Copy non-ELF: out/target/product/taimen/system/lib/lib-imsv
FAILED: out/target/product/taimen/system/lib/lib-imsvideocodec.so
/bin/bash -c "(if prebuilts/clang/host/darwin-x86/clang-r383902/bin/llvm-readobj -h vendor/qcom/taimen/proprietary/lib-imsvideocodec.so >/dev/null 2>&1; then echo -e \"\\033[1mout/target/product/taimen/system/lib/lib-imsvideocodec.so: \\033[31merror:\\033[0m\\033[1m\" 'found ELF prebuilt in PRODUCT_COPY_FILES, use cc_prebuilt_binary / cc_prebuilt_library_shared instead.' \"\\033[0m\" >&2; echo -e \"\\033[1mout/target/product/taimen/system/lib/lib-imsvideocodec.so: \\033[31merror:\\033[0m\\033[1m\" 'found ELF file: vendor/qcom/taimen/proprietary/lib-imsvideocodec.so' \"\\033[0m\" >&2; false; fi ) && (mkdir -p out/target/product/taimen/system/lib/ ) && (rm -f out/target/product/taimen/system/lib/lib-imsvideocodec.so ) && (cp \"vendor/qcom/taimen/proprietary/lib-imsvideocodec.so\" \"out/target/product/taimen/system/lib/lib-imsvideocodec.so\" )"
out/target/product/taimen/system/lib/lib-imsvideocodec.so: error: found ELF prebuilt in PRODUCT_COPY_FILES, use cc_prebuilt_binary / cc_prebuilt_library_shared instead. 
out/target/product/taimen/system/lib/lib-imsvideocodec.so: error: found ELF file: vendor/qcom/taimen/proprietary/lib-imsvideocodec.so 
[ 27% 31881/114806] Copy non-ELF: out/target/product/taimen/system/lib/lib-imsv
FAILED: out/target/product/taimen/system/lib/lib-imsvtextutils.so
/bin/bash -c "(if prebuilts/clang/host/darwin-x86/clang-r383902/bin/llvm-readobj -h vendor/qcom/taimen/proprietary/lib-imsvtextutils.so >/dev/null 2>&1; then echo -e \"\\033[1mout/target/product/taimen/system/lib/lib-imsvtextutils.so: \\033[31merror:\\033[0m\\033[1m\" 'found ELF prebuilt in PRODUCT_COPY_FILES, use cc_prebuilt_binary / cc_prebuilt_library_shared instead.' \"\\033[0m\" >&2; echo -e \"\\033[1mout/target/product/taimen/system/lib/lib-imsvtextutils.so: \\033[31merror:\\033[0m\\033[1m\" 'found ELF file: vendor/qcom/taimen/proprietary/lib-imsvtextutils.so' \"\\033[0m\" >&2; false; fi ) && (mkdir -p out/target/product/taimen/system/lib/ ) && (rm -f out/target/product/taimen/system/lib/lib-imsvtextutils.so ) && (cp \"vendor/qcom/taimen/proprietary/lib-imsvtextutils.so\" \"out/target/product/taimen/system/lib/lib-imsvtextutils.so\" )"
out/target/product/taimen/system/lib/lib-imsvtextutils.so: error: found ELF prebuilt in PRODUCT_COPY_FILES, use cc_prebuilt_binary / cc_prebuilt_library_shared instead. 
out/target/product/taimen/system/lib/lib-imsvtextutils.so: error: found ELF file: vendor/qcom/taimen/proprietary/lib-imsvtextutils.so 
22:34:16 ninja failed with: exit status 1

以下是我的构建步骤:

mkdir ~/bin
export PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
repo init -u https://android.googlesource.com/platform/manifest -b master
repo sync -c -j4
wget https://dl.google.com/dl/android/aosp/google_devices-taimen-qq1a.191205.008-f4537f93.tgz
tar xvf google_devices-taimen-qq1a.191205.008-f4537f93.tgz
./extract-google_devices-taimen.sh
wget https://dl.google.com/dl/android/aosp/qcom-taimen-qq1a.191205.008-760afa6e.tgz
tar xvf qcom-taimen-qq1a.191205.008-760afa6e.tgz
./extract-qcom-taimen.sh
. build/envsetup.sh
lunch aosp_taimen-userdebug
m

自从我第一次构建 AOSP 以来,我无法理解错误 found ELF prebuilt in PRODUCT_COPY_FILES, use cc_prebuilt_binary / cc_prebuilt_library_shared instead.

请告诉我该怎么做。谢谢。

【问题讨论】:

    标签: android android-source android-10.0


    【解决方案1】:

    Issue Link 可能对您阅读有所帮助。

    对于您的问题,我认为它与您下载的设备二进制文件有关。

    尝试下载最新的,列在底部,为您像素 2 XL。

    重做 extract*.sh 部分并重新制作!

    【讨论】:

    • 虽然链接中的内容可能会回答问题,但请考虑在此答案中描述该内容。该链接可以随时更改,使您的答案无用。
    【解决方案2】:

    我遇到了同样的错误。 是的,我们可以将此标志添加到 BoardConfig.mk,但这不是一个干净的解决方案,因为 Google 鼓励使用 Android.bp 文件而不是 Makefiles。这就是宋代建议使用这些模块的原因(cc_prebuilt_binary / cc_prebuilt_library_shared)。

    在我的情况下,通过在我放置预建库的存储库中创建 Android.bp 文件解决了这个问题,然后我将它们作为产品包添加到产品 mk 文件中。这是一个例子:

    Android.bp:

    cc_prebuilt_library {
    name: "product_package_name_in_MK_file",
    relative_install_path: "sub_lib/sub_sub_lib",
    stem: "output_file_name", // .so will be added automatically to out file name.
    compile_multilib: "both",
    multilib: {
    lib32: {
    srcs: ["path for src 32bit lib"],
    },
    lib64: {
    srcs: ["path for src 64bit lib"],
    },
    },
    strip: {
    none:true,
    },
    allow_undefined_symbols: true,
    check_elf_files: false,
    vendor: true,
    enabled: true,
    }
    

    product_mk 文件:

    ...
    PRODUCT_PACKAGES += product_package_name_in_MK_file
    ...
    

    【讨论】:

      猜你喜欢
      • 2013-12-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-03
      • 2017-06-26
      • 2017-07-07
      相关资源
      最近更新 更多