使用 this guide 在 Arch Linux 上编译 Android Automotive OS 时在编译的最后阶段你可能会得到这样的错误:
FAILED: out/target/product/generic_x86_64/system-qemu.img
/bin/bash -c "(export SGDISK=out/host/linux-x86/bin/sgdisk SIMG2IMG=out/host/linux-x86/bin/simg2img; device/generic/goldfish/tools/mk_combined_img.py -i out/target/product/generic_x86_64/system-qemu-config.txt -o out/target/product/generic_x86_64/system-qemu.img)"
File "device/generic/goldfish/tools/mk_combined_img.py", line 48
print "'%s' cannot be converted to int" % (line[2])
^
SyntaxError: invalid syntax
最佳答案
如果在 Arch linux 上编译 AOSP 时出现此错误,您需要转到文件 /android/device/generic/goldfish/tools/mk_combined_img.py
并更改第一行: #!/usr/bin/python
到 #!/usr/bin/python2
现在应该可以正常编译了...
关于python - 文件 "device/generic/goldfish/tools/mk_combined_img.py",第 48 行打印 "' %s' 无法转换为 int"%(第 [2] 行),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64230597/