9.0代码编译报错:
root@PowerEdge-R720xd:/home/share/work/3399-9.0:make -j12
21:11:12 Waiting up to 10s to lock /home/share/work/3399-9.0/out/.lock to ensure no other Soong process is running in the same output directory
21:11:13 Waiting up to 9s to lock /home/share/work/3399-9.0/out/.lock to ensure no other Soong process is running in the same output directory
21:11:22 Tried to lock /home/share/work/3399-9.0/out/.lock, but timed out polling every 1s until 10s . Make sure no other Soong process is using it
#### failed to build some targets (01:31 (mm:ss)) ####
查看make进程是否被占用,如果没有被占用,删除out/.lock,重新编译
---------------------------------------------------------------------------------------------------
[ 0% 13/24225] Target buildinfo:
out/target/product/rk3288/obj/ETC/system_build_prop_intermediates/build.prop
FAILED: /bin/bash -c "(echo > out/target/product/rk3288/obj/ETC/system_build_prop_intermediates/build.prop )
&& (TARGET_BUILD_TYPE=\"user\" TARGET_BUILD_FLAVOR=\"rk3288-user\"
TARGET_DEVICE=\"rk3288\"
...
echo \"dalvik.vm.stack-trace-file=/data/anr/traces.txt\" >>
out/target/product/rk3288/obj/ETC/system_build_prop_intermediates/build.prop ) &&
(cat out/target/product/rk3288/android-info.txt | grep 'require version-' |
sed -e 's/require version-/ro.build.expect./g' >>
out/target/product/rk3288/obj/ETC/system_build_prop_intermediates/build.prop ) &&
(build/tools/post_process_props.py out/target/product/rk3288/obj/ETC/
system_build_prop_intermediates/build.prop )"
/bin/bash: -c: 行 0: 寻找匹配的 `"' 是遇到了未预期的文件结束符
/bin/bash: -c: 行 1: 语法错误: 未预期的文件结尾
[ 0% 12/22456] host C++: libmcldLD <= frameworks/compile/mclinker/lib/LD/GarbageCollection.cpp
ninja: build stopped: subcommand failed.
make: *** [ninja_wrapper] 错误 1
此问题查了很久,后发现同事是修改这个位置导致语法错误,生成build.prop失败:
PRODUCT_PROPERTY_OVERRIDES += \
ro.product.version = 1.4.0 \
ro.product.ota.host = 119.23.31.208:2300 \
ro.sys.sdcardfs = true
# ro.product.ota.host = 47.97.203.147:2300 \
去掉# ro.product.ota.host = 47.97.203.147:2300 \ 这一行编译通过
device\rockchip\rk3288\rk3288.mk
注:这种问题报错没有明确那一个文件那一行,只知道是build.prop生成失败,然后逐步排查会生成build.prop属性的文件,检查其语法问题,此类问题多为人为修改错误导致,需仔细排查
------------------------------------------------------------------------------------------------------------
添加属性persist.sys.usbdeviceswitch.open,编译报错
error: persist.sys.usbdeviceswitch.open cannot exceed 31 bytes: persist.sys.usbdeviceswitch.open (32)
从字面可以看出:字节超出允许范围,属性的最大字节只能是31个字节,修改属性为:persist.sys.usbdevices.open
------------------------------------------------------------------------------------------------------------
需要的目标“out/host/linux-x86/framework/host-libprotobuf-java-2.3.0-nano.jar”。 停止
编译Launcher3报错,如果未曾完整编译整个android工程,那么在使用mm或者mmm的时候可能会遇到无法找到某些依赖库的情况,这时你可以用mma进行编译,它会同时编译你所需要的依赖库,只要进行一次mma编译就可以了,后续可直接使用mm或者mmm来编辑。
--------------------------------------------------------------------------------------------------------------
manifest.xml:1: parser error : Document is empty
[ 27% 2515/9266] target Package: SystemUI (out/target/product/rk3288/obj/APPS/SystemUI_intermediates/package.apk)
warning: string 'notifications_off_text' has no default translation.
修改device/rockchip/common/BoardConfig.mk
SYSTEM_WITH_MANIFEST ?= true 修改成 false 即可
此问题一般是删除repo导致
--------------------------------------------------------------------------------------------------------------
/bin/sh: 1: lzop: not found
缺少lzop导致, sudo apt-get install lzop
flex-2.5.39: fatal internal error, exec of /usr/bin/m4 failed
/bin/bash:bison 未找到命令
sudo apt-get install bison
/bin/bash: xmllint: command not found
sudo apt-get install libxml2-utils
-----------------------------------------------------------------------------------------------------------
make: *** [kernel.img] Error 127
安装64bit机子对32bit程序运行的支持.
#sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386
----------------------------------------------------------------------------------------------------------
make: *** [out/host/linux-x86/obj/lib/libart.so] 错误 1
clang编译器导致的问题
出错环境:Ubuntu 16.04 编译5.1 6.0系统
目前可行的修改方法时在art/build/Android.common_build.mk ,中将host 默认编辑器使用clang关掉,找到WITHOUT_HOST_CLANG
关闭clang即可
# Host.
ART_HOST_CLANG := false
ifneq ($(WITHOUT_HOST_CLANG),false)
# By default, host builds use clang for better warnings.
ART_HOST_CLANG := true
endif
---------------------------------------------------------------------------------------------------------------------------
在源码编译时,出现"make: *** [out/target/common/obj/PACKAGING/checkapi-current-timestamp] 错误 38 "信息
make update-api
-----------------------------------------------------------------------------------------------------------------------
没有规则可以创建“out/target/common/obj/APPS/CalculatorTests_intermediates/classes-full-debug.jar”需要的目标“out/target/common/obj/APPS/Calculator_intermediates/classes.jar”。 停止。
为了不编译Calculator,把android\packages\apps\Calculator里面的Adnroid.mk这个文件给重命名了导致的。重命名回Android.mk ,改为在build中屏蔽编译生成
-----------------------------------------------------------------------------------------------------------------------
7.1 预装apk编译报错
dex2oatd F 30422 30440 art/runtime/runtime_linux.cc:359]Fault message: /bin/bash: line 1: 30422 Aborted (core dumped) ( ANDROID_LOG_TAGS="*:e" out/host/linux-x86/bin/dex2oatd --runtime-arg -Xms64m --runtime-arg -Xmx512m --runtime-arg -classpath --runtime-arg "&" --boot-image=out/target/product/rk3399_all/dex_bootjars/system/framework/boot.art --dex-file=device/rockchip/rk3399/rk3399_all/preinstall/coach-tv-1.0.6/coach-tv-1.0.6.apk --dex-location=/system/vendor/bundled_persist-app/coach-tv-1.0.6/coach-tv-1.0.6.apk --oat-file=out/target/product/rk3399_all/obj/APPS/coach-tv-1.0.6_intermediates/oat/arm64/package.odex --android-root=out/target/product/rk3399_all/system --instruction-set=arm64 --instruction-set-variant=cortex-a53 --instruction-set-features=default --include-patch-information --runtime-arg -Xnorelocate --no-generate-debug-info --abort-on-hard-verifier-error --no-inline-from=core-oj.jar --compile-pic )
[ 98% 3893/3949] target R.java/Manifest.java: LiveTv (out/target/common/obj/APPS/LiveTv_intermediates/src/R.stamp)
原因是apk要预置进源码的时候,会对apk进行一个解析,好形成odex文件加速apk的运行,但是基于高版本的sdk开发的apk里面的一些资源是无法被低版本正确的解析的,解决办法就是,在mk文件里面禁止对该apk进行odex的处理。
1、LOCAL_DEX_PREOPT := false
2、让应用降低sdk版本与我们当前使用Android设备版本一致
https://blog.csdn.net/lb5761311/article/details/90294373