问题描述
在使用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
现在应该可以编译了...