android를 빌드하다 보면 아래와 같이 build error가 날때가 있다.
아래 build error는 zlib를 쓰는 python의 자체 에러로 이미 python issue tracker에 report 되어 있었다. (참조 :
http://bugs.python.org/issue8571 )
Traceback (most recent call last):
File
"./build/tools/releasetools/img_from_target_files", line 234, in
main(sys.argv[1:])
File
"./build/tools/releasetools/img_from_target_files", line 220, in main
AddSystem(output_zip)
File
"./build/tools/releasetools/img_from_target_files", line 172, in
AddSystem
common.ZipWriteStr(output_zip, "system.img" + post_fs_type, data)
File "/home/kyunam.jo/build/tools/releasetools/common.py",
line 658, in ZipWriteStr
zip.writestr(zinfo,
data)
File
"/usr/lib/python2.6/zipfile.py", line 1106, in writestr
bytes =
co.compress(bytes) + co.flush()
SystemError:
../Objects/stringobject.c:4271: bad argument to internal function
아마 대부분 ubuntu 10.04 버전의 build server를 사용한다면 발생하는 에러로 이는 ubuntu 10.04에 default로 들어간 python의 버전이 2.6.5이기 때문이다.
해당 버전은 2.6.5 버전 이후 2010년 5월 8일에 fix되어 반영됬으며 이는 아래 링크를 보면 확인 가능하다.
따라서 위와 같은 build error 가 발생할 경우 python을 최신으로 버전업하기 바란다.
그렇다고 python3으로 버전업은 조금 지양한다. (구문이 좀 달라진게 있으므로...^^)