fileslist_util.py是将json数据转换为txt文件
具体报错信息在打印上面一点的位置
UnicodeEncodeError: ‘ascii’ codec can’t encode characters in position 67-70: ordinal not in range(128)
很明显,在67-70行有 ascii 编解码器无法识别的字符,大概率是有中文字符
\out\target\product\机型名称\installed-files.json
\out\target\product\机型名称\installed-files.txt
先打开installed-files.txt 可以看到打印到/system/fonts/NotoSansCJK-Regular.ttc后面就没有了
再在打开installed-files.json,可以看到预制的apk中有中文字符
解决办法
方法1.更改预制apk的文件名称,让其不包含中文字符
方法2.更改文件解码方式,使用utf-8支持中文的编码格式
在:build/tools/fileslist_util.py 开头加上
import sys
reload(sys)
sys.setdefaultencoding('utf8')