Ubuntu编译AOSP时遇dex2oatd报错:ANDROID_DATA未设置且/data不存在
Ubuntu编译AOSP时dex2oatd崩溃报错求助
环境信息
- 操作系统:Ubuntu 22.04.3 LTS
报错详情
执行make命令编译AOSP时触发如下错误:
klee@linux:~/AOSP/aosp$ make ...... [ 0% 2/12593] build out/target/produc...wer_intermediates/oat/arm/package.odex FAILED: out/target/product/generic/obj/APPS/HTMLViewer_intermediates/oat/arm/package.odex /bin/bash -c "(mkdir -p out/target/product/generic/obj/APPS/HTMLViewer_intermediates/oat/arm/ && rm -f out/target/product/generic/obj/APPS/HTMLViewer_intermediates/oat/arm/package.odex ) && (find out/target/common/obj/APPS/HTMLViewer_intermediates/ -maxdepth 1 -name \"classes*.dex\" | sort | xargs zip -qjX out/target/product/generic/obj/APPS/HTMLViewer_intermediates/oat/arm/package.odex ) && (mv out/target/product/generic/obj/APPS/HTMLViewer_intermediates/oat/arm/package.odex out/target/product/generic/obj/APPS/HTMLViewer_intermediates/oat/arm/package.odex.input ) && (rm -f out/target/product/generic/obj/APPS/HTMLViewer_intermediates/oat/arm/package.odex ) && (mkdir -p out/target/product/generic/obj/APPS/HTMLViewer_intermediates/oat/arm/ ) && (ANDROID_LOG_TAGS=\"*:e\" out/host/linux-x86/bin/dex2oatd --runtime-arg -Xms64m --runtime-arg -Xmx512m --class-loader-context=\"&\" --boot-image=out/target/product/generic/dex_bootjars/system/framework/boot.art --dex-file=out/target/product/generic/obj/APPS/HTMLViewer_intermediates/oat/arm/package.odex.input --dex-location=/system/app/HTMLViewer/HTMLViewer.apk --oat-file=out/target/product/generic/obj/APPS/HTMLViewer_intermediates/oat/arm/package.odex --android-root=out/target/product/generic/system --instruction-set=arm --instruction-set-variant=generic --instruction-set-features=default --runtime-arg -Xnorelocate --compile-pic --no-generate-debug-info --generate-build-id --abort-on-hard-verifier-error --force-determinism --no-inline-from=core-oj.jar --compiler-filter=quicken ) && (rm out/target/product/generic/obj/APPS/HTMLViewer_intermediates/oat/arm/package.odex.input )" dex2oatd F 10-23 16:22:30 2859 2859 utils.cc:762] ANDROID_DATA not set and /data does not exist Runtime aborting... Dumping all threads without appropriate locks held: thread list lock mutator lock All threads: DALVIK THREADS (0): "dex2oatd" prio=5 (not attached) | sysTid=2859 nice=0 cgrp=default | state=R schedstat=( 20700891 0 180 ) utm=0 stm=1 core=2 HZ=100 native: #00 pc 00000000004f55f9 /home/klee/AOSP/aosp/out/host/linux-x86/lib64/libartd.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, int, BacktraceMap*, char const*, art::ArtMethod*, void*)+217) native: art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, BacktraceMap*, char const*, art::ArtMethod*, void*) native: art/runtime/native_stack_dump.cc:300 native: #01 pc 00000000005eda90 /home/klee/AOSP/aosp/out/host/linux-x86/lib64/libartd.so (art::ThreadList::DumpUnattachedThreads(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool)+352) native: art::DumpUnattachedThread(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, bool) native: art/runtime/thread_list.cc:166 native: art::ThreadList::DumpUnattachedThreads(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool) native: art/runtime/thread_list.cc:189 native: #02 pc 00000000005ed860 /home/klee/AOSP/aosp/out/host/linux-x86/lib64/libartd.so (art::ThreadList::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool)+288) native: art::ThreadList::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool) ...... "dex2oat watch d" prio=5 (not attached) | sysTid=2860 nice=0 cgrp=default | state=S schedstat=( 30164 0 1 ) utm=0 stm=0 core=0 HZ=100 kernel: (couldn't read /proc/self/task/2860/stack) native: #00 pc 0000000000069117 /usr/lib/x86_64-linux-gnu/libc.so.6 (???) native: #01 pc 000000000006be9a /usr/lib/x86_64-linux-gnu/libc.so.6 (pthread_cond_timedwait+570) native: __vfwscanf_internal native: ./stdio-common/vfscanf-internal.c:1733 native: #02 pc 000000000001612d /home/klee/AOSP/aosp/out/host/linux-x86/bin/dex2oatd (art::WatchDog::Wait()+109) ....... /bin/bash: line 1: 2859 Aborted (core dumped) ( ANDROID_LOG_TAGS="*:e" out/host/linux-x86/bin/dex2oatd --runtime-arg -Xms64m --runtime-arg -Xmx512m --class-loader-context="&" --boot-image=out/target/product/generic/dex_bootjars/system/framework/boot.art --dex-file=out/target/product/generic/obj/APPS/HTMLViewer_intermediates/oat/arm/package.odex.input --dex-location=/system/app/HTMLViewer/HTMLViewer.apk --oat-file=out/target/product/generic/obj/APPS/HTMLViewer_intermediates/oat/arm/package.odex --android-root=out/target/product/generic/system --instruction-set=arm --instruction-set-variant=generic --instruction-set-features=default --runtime-arg -Xnorelocate --compile-pic --no-generate-debug-info --generate-build-id --abort-on-hard-verifier-error --force-determinism --no-inline-from=core-oj.jar --compiler-filter=quicken ) ninja: build stopped: subcommand failed. 16:22:42 ninja failed with: exit status 1 make: *** [build/core/main.mk:21: run_soong_ui] Error 1 klee@linux:~/AOSP/aosp$
核心错误提示:ANDROID_DATA not set and /data does not exist(未设置ANDROID_DATA环境变量,且系统中不存在/data目录)
求助说明
已全网搜索该问题但未找到有效解决方案,花费数日排查仍无法解决,恳请各位提供修复方法。
内容的提问来源于stack exchange,提问作者Klee
相关产品推荐
相关产品推荐

