文件“ device / generic / goldfish / tools / mk_combined_img.py”,第48行打印“'%s'无法转换为int”%第[2]行

问题描述

在使用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

现在应该可以编译了...

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...